Greedy Snake mini-game developed by ES6 modularly

2022-02-08
1 min read
Featured Image

Project Features

  • Interactive functions implemented by native js

  • ES6 modular development

  • Divided into four classes

    • Food Class: generate a food with random position.
    • Snake Class: initialize a snake, add one unit of lenth, enable movement and moniter if the sanke is dead.
    • Rules Class: set up the speed, score, when to start and end, rules of eating food and hit the wall.
    • Entry Class: is like main function in java, rely on rule Class, imported in index.html.

Project’s technology stack

html, CSS, JS

Project source code

For the souce code simply inspect the page.

Please click to check the project

Avatar
Aaron Fan My research interests include machine learning, signal processing, web development and robotics.