Releases: Xeyo-Developer/Rust-SnakeGame
Releases ยท Xeyo-Developer/Rust-SnakeGame
Rust Snake Game v1.0.2 (4Fun edition)
Update 1.0.2
Rust Snake Game v1.0.1
Update README.md
Rust Snake Game v1.0.0
๐ Rust Snake Game
A classic Snake game written in Rust using the Piston Window library. The game offers smooth gameplay with animated visual effects and charming details.
โจ Features
- Classic Snake mechanics - move around the board, collect food and grow
- Animated visual effects:
- Pulsating food with glowing effect
- Animated snake tongue (extends randomly)
- Snake eyes pointing in the direction of movement
- Multi-layered board border
- Automatic restart after game over
- Smooth controls with arrow keys
- Responsive interface with VSync enabled
๐ฎ Controls
- Arrow Keys - control the snake
- ESC - exit the game
๐ ๏ธ Requirements
- Rust
- Cargo
๐ฆ Installation and Running
- Clone the repository:
git clone https://github.com/Xeyo-Developer/Rust-SnakeGame/
cd Rust-SnakeGame- Run the game:
cargo run๐ฏ Game Rules
- Goal: Collect food (golden squares) to grow the snake
- Game Over: Hit the wall or your own tail
- Restart: Game automatically restarts after 1 second from game over
- Movement: Snake moves automatically, you only control the direction
๐๏ธ Architecture
The project consists of five main modules:
main.rs
- Application entry point
- Game window configuration (27x22 blocks)
- Main game loop handling events and rendering
game.rs
- Game logic and state management
- Collision handling and win/lose condition checking
- Food generation in random positions
- Snake movement timer (200ms per move)
snake.rs
- Snake implementation as a linked list of blocks
- Movement and direction handling
- Tongue animation with random timing
- Self-collision detection
drawing.rs
- All graphics rendering functions
- Game coordinates to pixel conversion
- Drawing blocks, eyes, tongue, and borders
- Visual effects (gradients, shadows)
๐จ Visual Details
- Block size: 25x25 pixels
- Board: 27x22 blocks (675x550 pixels)
- Colors:
- Background: Dark blue
[0.08, 0.10, 0.12, 1.0] - Snake head: Dark green
[0.20, 0.70, 0.20, 1.0] - Snake body: Light green
[0.30, 0.80, 0.30, 1.0] - Food: Golden
[0.96, 0.71, 0.20, 1.0]
- Background: Dark blue
- Effects:
- Block shadows for depth
- Pulsating food
- Animated tongue (red)
- White eyes with black pupils
๐ง Dependencies
[dependencies]
piston_window = "0.132.0"
rand = "0.9"๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
