-
write a new saga called
gameSaga
, this saga must react toGAME_START_REQUESTED
events and change the game state accordingly. -
add a new reducer called
targets
, and changeGameLayout
, to render<Target>
elements for each item in this state (hint: use a default state) -
Add a button to stop the game. When the game is stopped, it must be reset.
-
implement these rules in using sagas:
- when a target is clicked, it is destroyed,
- when a target is destroyed, the score is incremented by
(1 * scoreMultiplier)
, - when a target dies by itself, the lives are decremented by 1,
- each
TIME_INTERVAL
(defaults to 1 second), the target value decrements by 1, - a target dies by itself when its value reaches 0,
- update your game:
- each time a target is spawned, its coordinates are randomly chosen (but bound to the size of the game layout)
- every seconds, one target with a value of 3 is spawned
- after 5 killed targets, two are spawned every second
- after 15 killed targets, three are spawned
- whenever the player kills 3 targets without losing a life, the
scoreMultiplier
is doubled - whenever the player loses one life, the
scoreMultiplier
is reset to 1
rule: all of this must be handled from the sagas (e.g: you can not send events from your react components to do that).
-
Add a way to increase difficulty by changing
TIME_INTERVAL
. -
Make this game fun. (all bonii must be listed when you deliver your game to your bored teacher)