fhylinjr / Classic-Snake-Game-Java-Script-With-Machine-Learning-Features-

A Classic Snake Game Using JavaScript's P5Js library and collide 2D library. Extra Features for using Machine Learning as well where user's poses dictates snake's movement

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Classic-Snake-Game-Java-Script-With-Machine-Learning-Features-

A Classic Snake Game Using JavaScript's P5Js library and collide 2D library. Extra Features for using Machine Learning as well where user's poses dictates snake's movement Submitted by: Philip Boakye Other Collaborators: Kelvin Forson

Time spent: 10 hours spent in total

User Stories

The following required functionality is completed:

  • User can can use arrow keys to control the snake
  • User can use either hand gestures or actual objects to play the game
  • Snake dies when it collides with itself or the canvas.
  • Computer or user's opponent randomly selects its object at each turn
  • User can choose to restart game at the end.
  • User and opponent's scores update after each turn

Video Walkthrough

Here's a walkthrough of implemented user stories:

GIF created with LiceCap.

Notes

Since I am very new to JavaScript and web dev, I had challenges figuring some updates. Besides getting the snake to align exactly as the boxes always was a problem. Also image classification could be improved. However, there are a lot of resources online and p5js documentation provides very good suggestions. If this is your first time, you need a lot of patience and reading stack errors from the logcat to figure out which lines and which files should be debugged. Feel free to comment and make improvements !!

License

Copyright [2020] [Philip Boakye]

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

About

A Classic Snake Game Using JavaScript's P5Js library and collide 2D library. Extra Features for using Machine Learning as well where user's poses dictates snake's movement


Languages

Language:JavaScript 88.6%Language:HTML 11.4%