Coder Social home page Coder Social logo

oss_snake_assignment's Introduction

OSS snake assignment

Simple version of the snake game.

๐Ÿ“ How to launch

First, yarn must be installed in your system. To install it, you must use the package manager npm. For more information, please visit https://docs.npmjs.com/downloading-and-installing-node-js-and-npm

Once npm is installed, you can run the following command to install yarn.

npm install -g yarn

If yarn is not working after running this command, try to close your terminal and reopen it. Or visit https://classic.yarnpkg.com/lang/en/docs/install

Then, to run the project, you must be at the root of the repository and run these following commands.

yarn install # Install dependencies
yarn parcel src/index.html # For development and then go to this url http://localhost:1234/
yarn parcel build src/index.html # For production, but you need a server to serve the build files.

To visualize the project, we recommend to launch the yarn parcel command for development and then go to this url http://localhost:1234/

๐Ÿ“œ Rules

To develop this game, we followed the classic rules of the snake game :

  • The size of the board is 40 x 40 or larger.
  • The snake starts at the center of the board, moving north (upward).
  • The snake moves at a constant speed.
  • The snake moves only north, south, east, or west.
  • An apple appears at a random location (but the location where the snake can reach).
    • There is always exactly one apple visible at any given time.
  • When the snake "eats" (runs into) an apple, it gets longer.
  • The game continues until the snake "dies".
    • The snake dies by either (1) running into the edge of the board, or (2) by running into its own body.
  • Once the snake dies, the final score is calculated based on the number of apples eaten by the snake.

โญ๏ธ Features

Here is the list of features implemented in the game :

  • Save and load the game
  • Ranking score
  • Highest score
  • Classic snake game
  • Pause the game
  • Change username
  • Auto play mode
  • Dual game mode

๐Ÿง‘โ€๐Ÿ’ป Coding convention

The project has been coded in HTML, SCSS and Typescript.

For HTML, we use the following coding convention -> https://www.w3schools.com/html/html5_syntax.asp

For SCSS, we use this one -> https://docs.gitlab.com/ee/development/fe_guide/style/scss.html

For typescript, here is the list of coding style rules :

Rules Description
Filename PascalCase if this is a class, otherwise kebab-case
Directory kebab-case
Class name PascalCase
Variable camelCase
Indentation 4 spaces, don't use tab

๐Ÿ‘จโ€๐Ÿ’ผ Authors

This project has been made by a group of three students at Chung Ang University :

  • Amaury Lecomte
  • Lucas Baykan
  • Valentin de Saint Jacob

For any question, please free to contact us :)

๐Ÿ“„ License

This project is licensed under the terms of the MIT license.

๐Ÿ“• Documentation

We use parcel to build the application. For more information -> https://parceljs.org/

๐Ÿ“ธ Screenshots

oss_snake_assignment's People

Contributors

brukols avatar lucasdc99 avatar valentindsj 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.