Skip to content

vo1d-null/SnakeGame

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Snake and Mouse game (WIP) by vo1d.null

About the code

This is a Snake game implemented in Python using the Pygame library. The game consists of a snake and a mouse, and the objective is to guide the snake towards the mouse so that it can eat it and grow longer. The player can control the direction of the snake using the arrow keys on the keyboard.

The game keeps track of the score, which is the length of the snake. When the snake collides with the mouse, its length is increased, and the mouse is randomly placed in a new location. If the snake collides with itself or the boundary of the game window, the game ends.

The code consists of three classes: Mouse, Snake, and Game. The Mouse class handles the movement and rendering of the mouse, while the Snake class handles the movement and rendering of the snake. The Game class initializes the game and handles the game loop, collision detection, and score display.

The code also includes functions for rendering the background, playing sound effects, and showing the game over screen.

Gameplay

In the game, a player controls a snake that moves around the screen trying to eat mice. As the snake eats mice, it grows in length, making the game more challenging. If the snake collides with the boundary or itself, the game is over. The objective of the game is to eat as many mice as possible and score as many points as possible.

How to Play

Use W, A, S, D keys to move the snake around the screen. The snake will grow as it eats mice. Avoid colliding with the boundary or itself. Eat as many mice as possible to score as many points as possible. To play again - press SPACE. To exit - Press ESC.

Screenshots:

sc1 sc2

Credits

The assets used in this game are sourced from the following websites:

kenney.nl freesound.org Background music by :

Velocity by kaleido | https://soundcloud.com/kaleidosounds Music promoted by https://www.free-stock-music.com Creative Commons / Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) https://creativecommons.org/licenses/by-sa/3.0/deed.en_US

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Snake and mouse game by vo1d.null

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages