Itheum / explorer-dapp

Itheum Explorer enables for the exploration of the Itheum protocol
GNU General Public License v3.0
453 stars 3 forks source link

XP Game: Add animations for when a user wins some points or gets 0 points #311

Closed newbreedofgeek closed 2 weeks ago

newbreedofgeek commented 6 months ago

When user plays game, they can win some points (in below example, they won 50 points)

image

3 reward states can happen:

  1. They win some points (like above.. anywhere between 5 and 50 points)
  2. They get 0 points (ui shows "rugged")
  3. They win the MAX price, which is 50 (in the above image, user actually won MAX price)

Data is returned by the data marshal in this schema:

gamePlayResult: {
          bitsScoreBeforePlay: -1, // points before current play
          bitsScoreAfterPlay: -1, // points after current play
          bitsWon: -1, // can be 0 for no win, no 5-50. -1 means they tried to paly to soon
          userWonMaxBits: -1, // the user just won the maximum bits? 1 for yes, -1 for no
          lastPlayedBeforeThisPlay: -1, // the timestampbefore current play
          lastPlayedAndCommitted: -1, // the latest timestamp of current play
          configCanPlayEveryMSecs: -1, // how many Mili seconds interval before being able to play again
          triedTooSoonTryAgainInMs: -1, // played too soon before allowed, so they have to wait this many Mili seconds to play (use for countdown timer to next play)
        }

What do you need to do?

Add some animation for the 3 reward states can happen above.

  1. They win some points (like above.. anywhere between 5 and 50 points) : check if bitsWon is > 0 and userWonMaxBits is -1. This means they won a normal price. Maybe show some balloons flying or something like this
  2. They get 0 points (ui shows "rugged"): check if bitsWon is === 0. Maybe show some rugs floating or something bad like this
  3. They win the MAX price, which is 50: check if userWonMaxBits = 1. Make a BIG animation of fireworks etc

Feel free to ask me for any questions on animation ideas.

newbreedofgeek commented 2 weeks ago

done