Use key to open the door
Start
Press key 'E'
Does player have key?
-> Yes -> Open the door -> End
-> No -> Show message: 'You need a key!' -> End
Move character with arrow keys
Start
Press arrow key
Which key is pressed?
-> Up -> Move up -> End
-> Down -> Move down -> End
-> Left -> Move left -> End
-> Right -> Move right -> End
Collect item and update inventory
Start
Player touches item
Is item collectible?
-> Yes -> Add item to inventory -> End
-> No -> Do nothing -> End
Attack enemy when close
Start
Enemy is near?
-> Yes -> Press 'Space' to attack
Is enemy hit?
-> Yes -> Reduce enemy HP -> Is enemy HP = 0?
-> Yes -> Defeat enemy -> End
-> No -> End
-> No -> End
-> No -> Do nothing -> End
Dialogue with NPC
Start
Player near NPC
Press key 'E'
Start dialogue
Is there more dialogue?
-> Yes -> Show next message -> Loop
-> No -> End dialogue -> End
Level complete when goal is reached
Start
Player reaches goal
Play win animation
Show message: 'Level Complete!'
Go to next level -> End
Lose when health = 0
Start
Take damage
Subtract health
Is health = 0?
-> Yes -> Show 'Game Over' -> Restart or Quit -> End
-> No -> Continue playing -> End
Unlock area with password
Start
Enter password
Is password correct?
-> Yes -> Unlock door -> Show message: 'Access granted' -> End
-> No -> Show message: 'Incorrect password' -> Retry -> End
Jump when pressing spacebar
Start
Press 'Space'
Is player on ground?
-> Yes -> Jump -> End
-> No -> Do nothing -> End
Timer countdown
Start
Start timer (60 seconds)
Each second: Subtract 1
Is timer = 0?
-> Yes -> End game -> Show 'Time's up!' -> End
-> No -> Continue -> Loop
Activate trap if player steps on tile
Start
Player steps on trap tile?
-> Yes -> Activate trap -> Damage player -> End
-> No -> Do nothing -> End
Choose character at start
Start
Show character options
Player selects character
Load selected character
Start game -> End