Giter VIP home page Giter VIP logo

snake_game's Introduction

snake_game

three JS snake game

program 5

By Haoxu Ren (hren3)

Description

Part 1: Display the playing field I initialize a white color play-zone in this project, and the screen shot is as following:

The food, snake can only exists in this white region, and if snake reach the boundary of this region, the game will end, and the final score is your snake’s length.

Part 2: Display and animate snake

The snake is composed by some cube, the initial length of snake is 4, and snake’s head is red, each time the snake eats a food successfully, the snake’s length will plus 1, and the final result is your snake’s length.

Part 3: Add food items and object interactions The food in this project is simply a cube, and this cube’s color is random, everytime is different, once the food ate by snake, there will generate another one at once randomly in the whole play region.

Part 4: Display and interact with non-player snake

The non-player snake is a green head snake, and it will never reach out the boundary, but if your snake reach this NPC snake or reach your own snake, you will die, and the game will end.

The simple demo video is available on : https://youtu.be/HEb-4s46WiQ

snake_game's People

Contributors

rhxbupt avatar

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.