GithubHelp home page GithubHelp logo

canhnd58 / duosnake Goto Github PK

View Code? Open in Web Editor NEW
2.0 3.0 0.0 69 KB

Game of one snake is too easy. How about game of two snakes?

Home Page: https://canhnd58.github.io/duosnake/

HTML 1.34% Shell 2.38% JavaScript 95.21% CSS 1.07%
snake-game

duosnake's Introduction

Duo snake

This is the place to test what we learnt and want to learn. Code anything you like.

Click here to play.

duosnake's People

Contributors

canhnd58 avatar tung-eh avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

duosnake's Issues

Allow multiple drawing modes

Allow at least two drawing modes:

  • pixelated: the snakes move cell by cell (current version)
  • continuous: the snakes move more smoothly

Add VFX class/functions

Create a class or functions to add visual effects to an area in canvas when called.

For example: heart drawing animation

Create simple server to connect two players

  1. Provide a link
  2. When player 1 connects, his/her console should display "Player 1 connected"
  3. When player 2 connects, the console of player 1 should display "Player 2 connected"

Don't need to synchronize game state now

Add play/replay buttons

Currently the game start automatically. To restart, these commands can be run in the console

game.reset()
game.start()

Introduce snake status

Food can affect oneself or the other with various effects. Some ideas:

  • dizzy: reduce movement speed.
  • confused: move to the opposite direction of player's input.
  • sick: lose body parts.
  • insane: bite oneself or the other ignoring sanity (love).
  • blind: lose visibility.

Change sanity to love

  • Each snake has a love value towards itself (self-love) and the other (other-love).
  • When self-love drops below zero, he will bite himself.
  • When other-love drops below zero, he will bite the other one.
  • Self-love decreases when only he grows (being lonely).
  • Other-love decreases when his food is stolen.

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.