Skip to content

qpre/sagas-101

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

  1. write a new saga called gameSaga, this saga must react to GAME_START_REQUESTED events and change the game state accordingly.

  2. add a new reducer called targets, and change GameLayout, to render <Target> elements for each item in this state (hint: use a default state)

  3. Add a button to stop the game. When the game is stopped, it must be reset.

  4. 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,
  1. 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).

  1. Add a way to increase difficulty by changing TIME_INTERVAL.

  2. Make this game fun. (all bonii must be listed when you deliver your game to your bored teacher)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published