Skip to content

GDG-Accra/snake_game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

Simple Snake Game

This is a basic implementation of the classic Snake game using HTML, CSS, and JavaScript. It provides a foundation for learning game development concepts and can be easily expanded upon with additional features.

Features

  • Simple and intuitive gameplay.
  • Keyboard controls (arrow keys).
  • Collision detection (walls and self).
  • Food generation and consumption.
  • Game over alert.

How to Play

  1. Clone or download the repository to your local machine.
  2. Open the snake.html file in your web browser.
  3. Use the arrow keys (Up, Down, Left, Right) to control the snake's direction.
  4. Eat the red "food" to grow longer.
  5. Avoid hitting the walls or yourself.

Getting Started

To run the game, simply open the snake.html file in your web browser. No server setup or installation is required.

Controls

  • Up Arrow: Move the snake up.
  • Down Arrow: Move the snake down.
  • Left Arrow: Move the snake left.
  • Right Arrow: Move the snake right.

Future Enhancements

This is a basic version of the game, and there are many ways to improve it. Here are some ideas:

  • Scoring: Implement a scoring system.
  • Difficulty Levels: Add different difficulty levels (e.g., by increasing the speed).
  • Different Food Types: Introduce different types of food with varying point values or effects.
  • Improved Graphics: Use more visually appealing graphics for the snake and food.
  • Touch Controls: Add touch controls for mobile devices.
  • Game Over Screen: Replace the alert box with a more engaging game over screen.
  • Sound Effects: Add sound effects for actions like eating food or colliding.
  • Pause/Resume Functionality: Implement a pause/resume feature.
  • High Score Tracking: Store and display the high score using local storage.

Technologies Used

  • HTML
  • CSS
  • JavaScript

Contributing

Contributions are welcome! If you have any ideas for improvements or bug fixes, feel free to submit a pull request.

  1. Fork the repository.
  2. Create a new branch for your feature or bug fix.
  3. Make your changes.
  4. Commit your changes with a descriptive message.
  5. Push your changes to your forked repository.
  6. Submit a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for details. (You should create a LICENSE file in your repository with the MIT license text if you intend to use the MIT License).

Acknowledgements

This project was inspired by the classic Snake game.

Author

GDG Accra

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages