Monday Goal: Start by following along with the example from Exploring Asynchrony with setInterval and setTimeout. Then choose one of the following projects to build. Build out the game logic, including using async callbacks with
setTimeout(). Add testing with Jasmine and Karma. Make sure that you continue to use Gulp tasks and keep your business logic separate from the user interface logic.
Tuesday Goal: Continue to build out your game and use Giphy’s API to incorporate GIFs. If you have extra time, experiment with different ways of making API calls and refactor to use promises (see Tuesday night’s homework). You are also welcome to incorporate a different API in your project if you wish.
Continue to build out the logic from the game in this weekend’s lessons. Add levels, difficulty settings and different items. In addition to the bear’s food level, consider adding other levels such as a mood level, sleep level, etc.
You may have had the chance to make a Tamagotchi application in your Level 2 class. If you didn’t, or if you did but you’d like another opportunity to create an application that can deal with the passage of time and asynchronicity, here’s your chance.
The Tamagotchi was one of the most popular toys of the late ‘90’s and early ‘00’s. It was a handheld, digital pet that could be carried around on a keychain-sized mini computer. Tamagotchis required loving care by pressing buttons to feed them, play with them, and put them to sleep. If you didn't give a Tamagotchi enough food, attention or rest, it would die.
Create an application using
setInterval() to adjust a Tamagotchi’s food, play and sleep levels (as well as any other levels you’d like to add). Then create items and actions that can increase or decrease these levels. If you’re able to build out an application fully for one Tamagotchi, refactor so that a player can have multiple Tamagotchis.
If the Tamagotchi theme doesn’t resonate with you, apply a similar theme to an Animal Farm application. We don’t mean George Orwell’s Animal Farm (though you can go that direction if you like); instead, create an application where users have to feed and care for their animals.
Pandemic is a cooperative board game where players have to stop a deadly disease outbreak before it wipes out the planet. Build out your own timed version of Pandemic, taking as much or little inspiration from the game as you like.
setTimeout()to make the disease spread exponentially after a certain period of time).
If you really don’t want to build a game, create a timed flash card application that utilizes
You can also choose another game as inspiration (such as Civilization) or come up with another project that utilizes
setInterval(). Consider other ways you can utilize asynchrony in your code. Take the time to practice the concepts you learned over the weekend.