Skip to content

Instantly share code, notes, and snippets.

@jennymaeleidig
Created May 23, 2026 18:41
Show Gist options
  • Select an option

  • Save jennymaeleidig/3c5e4eba4db8ea7f82650db81a66fb36 to your computer and use it in GitHub Desktop.

Select an option

Save jennymaeleidig/3c5e4eba4db8ea7f82650db81a66fb36 to your computer and use it in GitHub Desktop.
function scene:initValues()
-- globals
PlayerInst = BattlePlayer()
EnemiesInst = BattleEnemies()
TurnManagerInst = BattleTurnManager()
StatusMessage = ""
BattleMainHandler = {
upButtonHold = function()
PlayerInst:readySelEnemy() -- Before attacking, the player must select an enemy.
end,
rightButtonHold = function()
PlayerInst:readyItem()
end,
downButtonHold = function()
PlayerInst:readyFlee()
end,
leftButtonHold = function()
PlayerInst:readyDefend()
end,
-- # TODO: remove, quick reset for testing
BButtonHeld = function()
StatusMessage = "reset"
scene:initValues()
end,
-- # TODO: remove
AButtonHeld = function()
StatusMessage = "Switched Turn"
TurnManagerInst:nextTurn()
end
}
-- scene setup
self.backgroundColor = Graphics.kColorWhite
self.inputHandler = BattleMainHandler
TurnManagerInst:nextTurn()
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment