Skip to content

This is my repository for the final project of the 'Object-Oriented JavaScript' Udacity course. It implements a simple JavaScript game that can be run in the browser.

Notifications You must be signed in to change notification settings

Jvinniec/frontend-nanodegree-arcade-game

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

frontend-nanodegree-arcade-game

Getting Started

Loading the Game

To load the game, simply open the index.html file in your webbrowser. Or, you can also go here to play the version on the master branch.

Movement

Player movement is handled in the same way as most normal games using the direction keys.

where:

  • Up : Moves player up
  • Down : Moves player one block down
  • Left : Moves player one block left
  • Right : Moves player one block right

Game Play

The goal of the game is to move the player from the starting position all the way to the water (blue squares) on the other side:

This must be done while avoiding the enemy characters:

TODO

Following are a list of features that I would like to implement:

  • Require obtaining a special object before completion
  • Have different objects on the map that bestow certain "powers" (like freezing enemies, invulnerability, etc...)
  • Difficulty mode (changes speed of enemies and adds one more)

The Original TODO List

Following are the base instructions outlined for the project from the Udacity course:

Students should use this rubric for self-checking their submission. Make sure the functions you write are object-oriented - either class functions (like Player and Enemy) or class prototype functions such as Enemy.prototype.checkCollisions, and that the keyword 'this' is used appropriately within your class and class prototype functions to refer to the object the function is called upon. Also be sure that the readme.md file is updated with your instructions on both how to 1. Run and 2. Play your arcade game.

For detailed instructions on how to get started, check out this guide.

Add Instructions:

  • How to load the game
  • How to play the game

Game functionality:

  • Allow players to move around

Enemy functionality:

  • The Enemy function, which initiates the Enemy by:
    • Loading the image by setting this.sprite to the appropriate image in the image folder
    • Setting the Enemy initial location
    • Setting the Enemy speed
  • The update method for the Enemy
    • Updates the Enemy location
    • Handles collision with the Player

Player functionality:

  • The Player function, which initiates the Player by:
    • Loading the image by setting this.sprite to the appropriate image in the image folder
    • Setting the Player initial location
  • The update method for the Player
  • The render method for the Player
  • The handleInput method, which should receive user input, allowedKeys (the key which was pressed) and move the player according to that input. In particular:
    • Left key should move the player to the left, right key to the right, up should move the player up and down should move the player down.
    • Recall that the player cannot move off screen
  • If the player reaches the water the game should be reset by moving the player back to the initial location (you can write a separate reset Player method to handle that).

Instantiate objects

  • Creating a new Player object
  • Creating several new Enemies objects and placing them in an array called allEnemies

About

This is my repository for the final project of the 'Object-Oriented JavaScript' Udacity course. It implements a simple JavaScript game that can be run in the browser.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 94.5%
  • HTML 2.8%
  • CSS 2.7%