GithubHelp home page GithubHelp logo

monish001 / frontend-nanodegree-arcade-game Goto Github PK

View Code? Open in Web Editor NEW

This project forked from udacity/frontend-nanodegree-arcade-game

0.0 1.0 0.0 225 KB

CSS 0.18% HTML 1.64% JavaScript 98.18%

frontend-nanodegree-arcade-game's Introduction

frontend-nanodegree-arcade-game

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.

Changes for the solution

  • Added GameCharacter class for common functionality of Enemy and Player classes. This includes implementation of render(), getNextInstanceId() and getBoundingRectangle(). getNextInstanceId() generates unique id for each new instance.
  • Enemy class implemented. This inherits GameCharacter and adds implementation of update(), resetSpeed() and resetPosition().
  • Player class implemented. This inherits GameCharacter and adds implementation of update(), handleInput(), reset() and resetPosition(). handleInput() prevents player from going off-screen.
  • Added Rectangle class for purpose of collision detection. This includes implementation of doesOverlap().
  • Handled collision detection using logic of whether or not bounding rectangle of player overlaps with any of enemy objects.
  • Handled scenario of winning.

Changes as per review comments

  • Added missing semicolons
  • player.reset() changed to this.reset()

How to Run

frontend-nanodegree-arcade-game's People

Contributors

6stringbeliever avatar bcuz avatar cherylcourt avatar durant-udacity avatar hkasemir avatar monish001 avatar nicolasartman avatar rhynodesigns avatar siakaramalegos avatar susansmith avatar walesmd avatar yyforyongyu avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.