Tutorial on building a javascript application with classes
You can check out any point of the tutorial using git checkout step-x
To see the changes which between any two lessons use the git diff command. git diff step-x..step-x
- Add a simple index.html file
- Add the app.js file with a plan map.
- Add the vector class to represent coordinate pairs
- Add the grid class to represent the map
- Add the Config object to store possible directions
- Add the Helper object with the randomElement function
- Add the BouncingCritter class (our first element of the game)
- Add an empty Wall class
- Add the World class that communicates (and creates) with the Grid
- Add two helper methods:
- elementFromChar (creates an element from a character)
- charFromElement (returns the original character from an element)
- Try the World object in the app.js file (check the console)
- Add the forEach method on the Grip class
- Add 3 methods on the World class:
- turn (gives the critters a chance to act)
- letAct (contains the actual logic that allows the critters to move)
- checkDestination (validates the destination point)
- Add the View class
- Animate the world from the app.js file
- Add the dirPlus helper
- Add the StraightCritter class
- Add our new critters in the map
- Add the ActionsHandler class with methods for: grow, move, eat, reproduce
- Change the World class in order to use the ActionsHandler. It also manage the energy level
- Add the energy property on the Wall and StraightCritter objects
- Learn the BouncingCritter to reproduce, eat and move
- Add the Plant element
- Update the map