-
Notifications
You must be signed in to change notification settings - Fork 1
GameLogic subsystem
Evan Harvey edited this page Apr 25, 2016
·
4 revisions
This diagram describes the overall logic behind the game itself. The diagram is generic and does not depict the specific interactions of the Shapes App. Those specific interactions will be explained below along with the diagram.
- This subsystem is called upon and starts running
- start up necessary graphic libraries and any background processes needed to run the game
- for shapes this will load the blocks and the grid that they will be used on
- load the data for that level of the game
- for shapes this will likely be the order the blocks fall
- at this point all game assets have been loaded and the game can begin
- move the game forward one tick
- for shapes this will include moving falling blocks downward and playing any animations (like a rotating block)
- did the user press anything since the last time this was called?
- yes: go to 7
- no: go to 8
- alter values and start any animations in reaction to the user input
- for shapes, if a block was pressed, start the animation to rotate that block
- update the game data based on the advancement of time by one tick
- for shapes this will include updating blocks that have finished an animation or have finished facing
- does the update from 8 activate a game mechanic?
- for shapes this would check if a shape has been formed by the blocks
- yes: go to 10
- no: go to 5
- use the game mechanic in 9 to alter the game data
- in shapes this will include starting the animation for removing the blocks that created a shape and adding to the score
- did the game end by the game mechanic?
- yes: go to 11
- no: go to 5
- for shapes this will show the score acquired during play and compare it to the high score, may have more options depending on the UI here
- Exit the subsystem when the user gives the right input, otherwise wait