/Tamagotchi

Practice arrow functions, setInterval

Primary LanguageJavaScript

  1. When the Tamagotchi is first created, it must be given a name.
  2. The Tamagotchi will have levels for fun, hunger, and sleep.
  3. For each of these, the Tamagotchi will being at a starting level of 100.
  4. You can feed it food to increase the hunger level, and various items will contribute various amounts. Grass will increase the level by 5, berries will increase it by 10, and meat will increase it by 15.
  5. You can play with the Tamagotchi to increase the fun level, and various activities will contribute various amounts. Petting it will increase the level by 5, taking it for a walk will increase the level by 10, and taking it skydiving will increase the level by 15.
  6. You can let the Tamagotchi sleep to increase the sleep level. Sleeping for 2 hours will increase the level by 5, sleeping for 4 hours will increase the level by 10, and sleeping for 8 hours will increase the level by 15.
  7. Every 10 seconds, each of the levels will go down by 10.
  8. If any of the levels go down to 0, the Tamagotchi dies.