Git Product home page Git Product logo

snake's Introduction

snake.html

description

Classic Snake. Open snake.html and use the arrow keys ⬅️ ⬆️ ➡️ ⬇️ to move!

Demo of snake.html

(Hint: you can accelerate.)

Note: This was prototyped in Microsoft Edge on a 24" monitor. Your experience may be suboptimal on significantly smaller or larger screens, or (less likely) other browsers.

background

HOW: Plain HTML + CSS + JS. No front-end libraries or game engines. This implementation is simply a dynamic CSS grid.

WHY: Practising the basics of web/front-end development. I began an accidental foray into web dev when I found myself in a team of three at the first Sound of AI hackathon, building a browser-based music visualiser based on the Cyanite API. This foray continued by stumbling on (and participating in) the Boolean Coding Week, a basic crash course in web development with Tic-Tac-Toe and Space Invaders as live examples. This ended on a Friday; by Saturday evening, I had built Snake.

to-do

⚠️ Bug alert! During some play instances, the snake randomly disappears from the grid. This has something to do with a sudden failure to access the classList of a cell (or multiple cells) in functions like eraseSnake, drawBlock, drawFood, etc. during runtime. Most instances work fine though—just refresh and restart if something funny happens.

  • Fix disappearing snake bug as mentioned: #1
  • Make CSS layout responsive (resizeable) to accommodate different screen sizes

snake's People

Contributors

frdysf avatar

Watchers

 avatar

snake's Issues

Fix random disappearing snake bug

During some (not all) play instances, the snake randomly disappears from the grid. This has something to do with a sudden failure to access the classList of a cell (or multiple cells) in functions like eraseSnake, drawBlock, drawFood, etc. during runtime.

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.