Giter VIP home page Giter VIP logo

js-game-project's Introduction

Coordinator 2000

The purpose of the game is to avoid stepping out of the way. It's a game of coordination eye-hand.

The game screen will be a a moving road viewed from above.

The player is represented by a dot (representing in turn a car) that moves only in horizontal each time the player clicks a button on the keyboard.

The final game will consist in 2 screens (left-right) with the same layout, but with different movements of the road, with the purpose of making it a challenge to maintain both dots in the middle of the road.

The game will finish at a certain point, and then the game over screen will show the percentage (%) of time that the player stepped out of the way from the start to the end, for both hands separately and altogether as well.


MVP

Technique

Html5 Canvas and Vanilla Javascript

Game states

  • Start Screen
    • Title
    • Play button
  • Game Screen
    • Canvas
  • Pause Screen
  • Game Over Screen
    • Play again button
    • Go to start screen button

Game

  • Create dot.
  • Move dot horizontally.
    • Click on right or left arrows to move player on the canvas.
  • Create the road.
    • First, a straight line.
    • Then, add turns, right or left.
  • Check collision (when the dot is stepping out of the road).
  • If collision -> Sum time that the dot is out of the way --> Change color of the dot.
  • Make it faster when time passes.
  • End game at a certain point (? seconds).

BACK LOG

Add the second screen

  • Both screens will run out at the same time, changing only the turns in each to make it difficult.

Score

  • Calculate % of time stepping out on both screens at the same time and show the average of both.

High score

  • Create High Score Screen.
  • Show latest score on Start Screen.
  • Add high score button to Start Screen.

Music

  • Add background music to game.
  • Add sound effect every time the dot gets out of the way.

Player colors

  • Add colors to overall play screen.

Levels

  • Maximum level shows Game Over if you step out of the line just once.

Data structure

main.js

createStartScreen(id);
createGameScreen(id);
createPauseScreen(id);
createGameOverScreen(id);
destroyStartScreen();
destroyGameScreen();
destroyPauseScreen(id);
destroyGameOverScreen();
let game = new Game({
    ctx: ctx,
    this.path,
    this.player
  });
game.start();

game.js

function Game(options){};
game.drawPlayer();
game.assignControlsToKeys();
game.generatePath();
game.checkCollision();
game.pause();
game.gameOver();
game.start();

player.js

function Player(){
  this.width;
  this.height;
  this.color;
};
player.move();

path.js

function Path(){
  this.width;
  this.height;
  backgroundcolor = ['xxx','xxx','xxx'];
};
moveForward();

Links

Kanban board on... Trello

Source code on... Github

View live on... Netlify

DEV live tests on... Netlify

Presentation on... GoogleSlides

js-game-project's People

Contributors

pablolo avatar

Watchers

James Cloos 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.