Giter VIP home page Giter VIP logo

dim-light-canvas-game's Introduction

Dim Light ๐Ÿ”ฅ

"Kill bugs. Survive the night."

Dim light is a survival game made on HTML5 Canvas. The player goal is to kill as many bugs as possible and remaining alive.

dim-light-character clone

Controls and game mechanics

Player moves with keys A, W, S, D and points its gun by moving the mouse and shoots by clicking on canvas.

The goal of the player is to survive multiple enemies attacking from outside of the canvas by keeping its torch lighted up, enemies may drop little flames that can be picked up by the player to bright up the scene.

When enemies attack the player, screen gets darker so enemies are also harder to see.

dim-lights-blackout-scren

Game ends when player's torch dies or player kills all enemies.

dim-lights-game-over-screen

Cool bits of the code

The game uses vectors to rotate the player to mouse position in canvas and get the next position of enemies and bullets.

dim-lights-vector-code

In order to make the enemies move towards the player, player's position is passed to enemies in every frame.

dim-lights-enemy-update-player-pos-code

Bullets move uniformly to mouse position ๐Ÿ”ซ

dim-lights-shooting-screen

What's next?

Cool retro games need bosses, it would be nice if player had to fight a big fat bug at the end of the game. Also could be more interesting if the player could move relative to the mouse position instead of moving relative to the canvas.

Another cool possible feature could be power ups or new guns.

Play the game

Go!

dim-light-canvas-game's People

Contributors

fcovacarh avatar

Watchers

James Cloos avatar

dim-light-canvas-game's Issues

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.