Code Monkey home page Code Monkey logo

frontend-nanodegree-arcade-game-master's Introduction

๐Ÿƒ Classic Arcade Game Clone ๐Ÿ›

Table of Contents ๐Ÿ”

GENERAL

This game is written with HTML\CSS\JavaScript. It contains canvas with three rows: Grass , Stones, Water. this game also include two important objects: Enemy and Player.

PROPERTIES

Multiple properties included with each constructor As:

  • X and y coordinates for both the player and the enemies.
  • Sprite which is necessary for setting the objects images.
  • Speed for the Enemy which is necessary for setting the speed for the enemy objects.

METHODS

Multiple methods are also necessary for the game to work such as:

  • update()
  1. Makes the enemies move along the x axis and the speed increases as the level increase.
  2. Update the enemies locations once they reach the right end of the canvas the method will move them back to the left end.
  3. Collision detection.
  4. Update the level once collision occurs, the value of the level variable will be 1.
  5. Move the player back to the initial location when collision occurs.
  • render()

    For both Enemy and Player. It draw the enemies and the player on the screen.

  • handleInput()

    just for the Player. It receives the user input and move the player according to the pressed key But it involves restrictions for the movement (The player won't be able to move outside the canvas). Once the player reach the water the level will increase by one and the player move back to the initial location.

HOW THE GAME WORKS

The player will be in its initial location and the enemies will keep on moving along the x axis. The player can move up, down, left and right inside the canvas. Once the player reaches the water it will be considered a win and the level increases by 1. The player must avoid the enemies.

HOW TO RUN THE GAME

  1. Open index.html file.
  2. Start moving the player by pressing the keyboard arrows (left, right, up and down).
  3. Avoid the collision with bugs to win the game.

Screenshot Screenshot

frontend-nanodegree-arcade-game-master's People

Contributors

abeerqqq 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.