-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from SuperSlide-Game/dev
First deliver
- Loading branch information
Showing
41 changed files
with
901 additions
and
398 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
454 changes: 237 additions & 217 deletions
454
app/src/main/java/com/example/superslidegame/game/GameLogic.kt
Large diffs are not rendered by default.
Oops, something went wrong.
23 changes: 0 additions & 23 deletions
23
app/src/main/java/com/example/superslidegame/game/animations/AnimationHelper.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
app/src/main/java/com/example/superslidegame/game/elements/Direction.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 18 additions & 8 deletions
26
app/src/main/java/com/example/superslidegame/game/elements/LevelSelectorClickListener.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,30 @@ | ||
package com.example.superslidegame.game.elements | ||
|
||
import android.content.res.ColorStateList | ||
import android.graphics.Color | ||
import android.util.SparseBooleanArray | ||
import android.view.View | ||
import android.view.View.OnClickListener | ||
import android.widget.Button | ||
import com.example.superslidegame.game.screen.SelectLevel | ||
|
||
class LevelSelectorClickListener(private val levelClicked: Int, private val activity: SelectLevel, private val button : Button, private val buttonStateArray : SparseBooleanArray) : OnClickListener { | ||
/** | ||
* LevelSelectorClickListener | ||
* This class is used to handle the click events of the level buttons in the level selector screen. | ||
* @param levelClicked The level that was clicked | ||
* @param activity The activity that the level selector is in | ||
* @param adapter The adapter that is used to display the level buttons | ||
*/ | ||
class LevelSelectorClickListener( | ||
private val levelClicked: Int, | ||
private val activity: SelectLevel, | ||
private val adapter: LevelListAdapter | ||
) : OnClickListener { | ||
|
||
override fun onClick(position: View?) { | ||
if (buttonStateArray.get(levelClicked, false)) { | ||
button.setBackgroundColor(Color.GREEN); // Change to the color you want when clicked | ||
} else { | ||
button.setBackgroundColor(Color.TRANSPARENT); // Change to the default color | ||
} | ||
// Set the level to the level clicked | ||
activity.setLevel(levelClicked + 1) | ||
// Set the background tint list of the button clicked to green | ||
position?.backgroundTintList = ColorStateList.valueOf(Color.GREEN) | ||
// Set the background tint list of the other buttons to the default color by refreshing the adapter | ||
adapter.notifyDataSetChanged() | ||
} | ||
} |
Oops, something went wrong.