-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tempest: Add empty game with controller.
This is the bare minimum required in order to add a new game to retrowars (assumping it uses a soft controller and not a touch screen - if just touch screen such as Missile Command then we could ommit the controller). Not particularly happy with the number of places things need to be added, but that can be addressed in the future as we add more games and realise where refactorings would be most appropriate.
- Loading branch information
Showing
5 changed files
with
91 additions
and
4 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
40 changes: 40 additions & 0 deletions
40
core/src/com/serwylo/retrowars/games/tempest/TempestGameScreen.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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package com.serwylo.retrowars.games.tempest | ||
|
||
import com.badlogic.gdx.Gdx | ||
import com.badlogic.gdx.graphics.OrthographicCamera | ||
import com.serwylo.retrowars.RetrowarsGame | ||
import com.serwylo.retrowars.games.GameScreen | ||
import com.serwylo.retrowars.games.Games | ||
import com.serwylo.retrowars.input.TempestSoftController | ||
import com.serwylo.retrowars.utils.Options | ||
|
||
class TempestGameScreen(game: RetrowarsGame) : GameScreen(game, Games.tempest, 400f, 400f) { | ||
|
||
companion object { | ||
@Suppress("unused") | ||
const val TAG = "TempestGameScreen" | ||
} | ||
|
||
private val state = TempestGameState() | ||
|
||
private val controller = TempestSoftController(Options.getSoftController(Games.tempest), game.uiAssets) | ||
|
||
init { | ||
addGameOverlayToHUD(controller.getActor()) | ||
showMessage("Shoot the enemies", "Don't let them touch you") | ||
} | ||
|
||
override fun show() { | ||
Gdx.input.inputProcessor = getInputProcessor() | ||
} | ||
|
||
override fun updateGame(delta: Float) { | ||
} | ||
|
||
override fun onReceiveDamage(strength: Int) { | ||
} | ||
|
||
override fun renderGame(camera: OrthographicCamera) { | ||
} | ||
|
||
} |
3 changes: 3 additions & 0 deletions
3
core/src/com/serwylo/retrowars/games/tempest/TempestGameState.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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package com.serwylo.retrowars.games.tempest | ||
|
||
class TempestGameState |
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