Third project from the Front-End Web Developer Nanodegree in
Udacity:
recreated the classic arcade game Frogger with Object-Oriented JavaScript and HTML5 Canvas.
Download the repository in your desktop, unzip it and open the "index.html" file in your browser to play the game.
Or you can play it here:
link to game

To play the game, use the arrow keys from your keyboard to move your player up, right, down and left.

Use the key Enter to change level or restart, when the game requires you to do so.
You will be provided visual assets and a game loop engine; using these tools you must add a number of entities to the game including the player characters and enemies to recreate the classic arcade game Frogger.
- If you need a refresher on Object Oriented JavaScript, review our course and OOJS Notes; if you'd like a more detailed explanation as to how the game engine works, see our HTML5 Canvas course.
- Read the detailed instructions for the project.
- Download the art assets and provided game engine.
- Review the video of the completed game and take note of the game's rules.
- Review the code and comments provided in app.js
- Identify the various classes you will need to write.
- Identify and code the properties each class must have to accomplish its tasks.
- Write the functions that provide functionality to each of your class instances.
"PlanetCute" art by Daniel Cook (lostgarden.com)
Game engine.js and resources.js by Udacity
Game sounds by Fins, Baidonovan, Seidhepriest and LittleRobotSoundFactory (freesound.org)
The project is licensed under the MIT license.
Implement Enemy function:set initial location and speedupdate method: updates position and handles collisionCreate several new Enemy objects and place them in allEnemies array
Implement Player function:handleInput method:receive user input and move Player accordinglyPlayer cannot move off screenif the Player reaches water, the game should resetCreate a new Player object
Create the storySelector to choose the heroSelector to choose the difficulty: easy, normal, hard, nightmare
Create big canvasPut trees, stones, paths, doorsCreate top menu for: hearts, keys, gems, level and restart
Interact: go over item --> item dissapears from screen and array --> counter goes upHearts:start with 5 lifeseach collision subtracts a lifeeach heart adds a lifewhen 0 lifes --> game over --> everything freezes --> restart button
Keys:use key to open doors (to pass the level)use key to open chests (to have gems)
Gems:1 blue gem: to walk underwater (in the checkObstacles)1 green gem: to walk through trees (in the checkObstacles)
Interact: try to go over door or chest --> checkObstacles --> if key --> do somethingChests:open chest with a key (change sprites)pick up gem inside (a wild gem has appeared!)
Doors:open door to pass level (in the checkObstacles) --> change level
Level:level 1level 2level 3level 4
- Sound:
when collision with bug- when collision with nature
when pick up item
- Errors:
- after changing levels, the bugs spend a couple of seconds not moving... no idea what to do here >.<
Player.stop: doesn't stop properly, is moving to the previous positionFix dialog's positionsdialog.show() doesn't close when changing leveldialog.show() doesn't work in Mozilla: find alternativeGame over: the Enter key doesn't work (it cannot restart)Fix checkObstacles functionGems: doesn't give power when has_gemChange level/state: implement it how?Finish level: create last level screen
- Improvements:
Implement sounds- Keep DOM Access to a minimum: use a helper method that batch-converts a dataset to HTML
- Enemy.update: simplify code (too many repeated if's --> put in functions?)
Go to next level automatically with setTimeoutJSHint the code