Giter VIP home page Giter VIP logo

whereisthelove's Introduction

Where is the Love? <3

A quick-reaction game based on Super Mario Party minigame "Looking for Love". Upon starting the game, the four shapes representing the suits of playing card appears randomly on the top, bottom, left, and right spots. Player uses the arrow keys to select the location of the heart before the shapes disappear. Each game has 10 rounds.

Click Here to Play!

game

Technologies

  • Javascript
  • Canvas
  • HTML5
  • CSS3

Features

level

Levels

Player can choose from 4 levels. Each level differs in the amount of time the shapes appear on screen, ranging from 2 seconds (easy) to 400 milliseconds (impossible). SetTimeout is used to control how long the shapes are displayed and how long the event listeners for arrowkeys are active.

    start() {
        let board = new Board(this.ctx, this.heartSpot, this.otherSpots);
        board.generate();
        this.arrowKeysControl = true;
        this.playingDisplay();

        setTimeout(this.clearSpots, this.speed);

        document.addEventListener("keydown", event => {
            if (this.arrowKeysControl) {
                this.arrowKeysControl = false;
                this.check(event.code);
            }
        })
    }

    clearSpots() {
        this.ctx.clearRect(0, 0, this.gameWidth, this.gameHeight);
        this.arrowKeysControl = false;
    }

Scoring

Answering correctly and quick enough earns the player 5 points. Incorrect answers results in negative 5 points. Not answering or delayed responses do not affect score.

Score Board

After each game, player's name (optional), score, and level is recorded under the score board. A maximum of 9 records are displayed. If there are any more than 9 records, the oldest one is removed using Node.removeChild().

    appendScoreBoard() {
        this.scoreBoardNum += 1;

        if (this.scoreBoardNum === 9) {
            dom.scorelist_ul.removeChild(scorelist_ul.firstChild);
            this.scoreBoardNum -= 1;
        }

        let div = document.createElement("div");
        div.innerText = this.name + "  |  " + this.point + "pts" + "  |  " + this.level;
        dom.scorelist_ul.appendChild(div);
    }

Sound Effects and Music

Player can toggle on and off sound effects and background music. By default, sound effects are on and background music off.

Future Plans

  • Include AI players.

whereisthelove's People

Contributors

hiuhin avatar

Watchers

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