{"id":18513554,"url":"https://github.com/anishvedant/snake-game","last_synced_at":"2025-05-14T12:34:13.541Z","repository":{"id":242978053,"uuid":"802735947","full_name":"anishvedant/Snake-game","owner":"anishvedant","description":"This project is a modern take on the classic Snake game, built using Python and Pygame. It features custom graphics, engaging sound effects, and a highscore tracking system. Enjoy playing the game while exploring the code to learn more about game development with Pygame.","archived":false,"fork":false,"pushed_at":"2024-06-07T03:41:57.000Z","size":9291,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-17T03:30:21.623Z","etag":null,"topics":["apple","classic-game","educational-project","game","game-development","games","gamespy","graphics-programming","highscore","interactive-games","open-source","pygame","python","pythongames","snake","snake-game","snake-game-2d","snakegame","snakegame-py"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anishvedant.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-19T05:54:02.000Z","updated_at":"2024-06-07T03:42:00.000Z","dependencies_parsed_at":"2024-06-06T02:32:13.922Z","dependency_job_id":"3570b2a4-6af4-4818-a183-0271bc9967bd","html_url":"https://github.com/anishvedant/Snake-game","commit_stats":null,"previous_names":["anishvedant/snake-game"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anishvedant%2FSnake-game","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anishvedant%2FSnake-game/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anishvedant%2FSnake-game/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anishvedant%2FSnake-game/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anishvedant","download_url":"https://codeload.github.com/anishvedant/Snake-game/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254142598,"owners_count":22021565,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apple","classic-game","educational-project","game","game-development","games","gamespy","graphics-programming","highscore","interactive-games","open-source","pygame","python","pythongames","snake","snake-game","snake-game-2d","snakegame","snakegame-py"],"created_at":"2024-11-06T15:39:14.758Z","updated_at":"2025-05-14T12:34:13.434Z","avatar_url":"https://github.com/anishvedant.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Snake Game with Python and Pygame\n\nThis is a classic Snake game implemented in Python using the Pygame library. The game features end-to-end functionality with graphical elements, sound effects, and a highscore tracking system.\n\n## Features\n\n- **Classic Snake Gameplay:** Move the snake to collect apples and grow longer.\n- **Graphics:** Custom graphics for the snake's head, body, and tail, as well as the apple.\n- **Sound Effects:** Background music and sound effects for eating apples and crashing.\n- **Highscore Tracking:** Keeps track of the highest score achieved.\n- **Pause and Resume:** Pause the game with the spacebar and resume it at any time.\n- **Game Over Screen:** Displays the player's score when the game ends.\n\n## Installation\n\n1. **Clone the Repository:**\n   ```bash\n   git clone https://github.com/anishvedant/snake-game.git\n   cd snake-game\n   ```\n\n2. **Install Dependencies:**\n   Ensure you have Python and Pygame installed. You can install Pygame using pip:\n   ```bash\n   pip install pygame\n   ```\n\n3. **Add Game Assets:**\n   Place the required graphic and sound files in the appropriate directories:\n   - `Graphics/head_up.png`\n   - `Graphics/head_down.png`\n   - `Graphics/head_right.png`\n   - `Graphics/head_left.png`\n   - `Graphics/tail_up.png`\n   - `Graphics/tail_down.png`\n   - `Graphics/tail_right.png`\n   - `Graphics/tail_left.png`\n   - `Graphics/body_vertical.png`\n   - `Graphics/body_horizontal.png`\n   - `Graphics/body_tr.png`\n   - `Graphics/body_tl.png`\n   - `Graphics/body_br.png`\n   - `Graphics/body_bl.png`\n   - `Graphics/apple.png`\n   - `Sound/crunch.wav`\n   - `Sound/crash.mp3`\n   - `Sound/music.mp3`\n   - `Font/PoetsenOne-Regular.ttf`\n\n## Usage\n\n1. **Run the Game:**\n   ```bash\n   python3 snake.py\n   ```\n\n2. **Gameplay Instructions:**\n   - Use the arrow keys to control the direction of the snake.\n   - Press `SPACE` to pause and resume the game.\n   - Press `ESC` to quit the game.\n\n## Game Mechanics\n\n### Snake Movement\n\nThe snake is controlled using the arrow keys:\n- `UP`: Moves the snake up (if it's not currently moving down).\n- `RIGHT`: Moves the snake right (if it's not currently moving left).\n- `DOWN`: Moves the snake down (if it's not currently moving up).\n- `LEFT`: Moves the snake left (if it's not currently moving right).\n\n### Growing the Snake\n\nWhen the snake eats an apple, it grows by one block. The position of the next apple is randomized within the game grid.\n\n### Collision Detection\n\nThe game ends if:\n- The snake collides with the walls (edges of the game window).\n- The snake collides with itself.\n\n### Highscore Tracking\n\nThe game tracks the highest score achieved and displays it on the screen. The highscore is saved in a `highscore.txt` file.\n\n### Sound Effects\n\n- **Background Music:** Loops continuously during the game.\n- **Crunch Sound:** Plays when the snake eats an apple.\n- **Crash Sound:** Plays when the game ends due to a collision.\n\n## Code Structure\n\n- `snake.py`: Main game file containing all the game logic and functions.\n- `Graphics/`: Directory containing the image assets for the game.\n- `Sound/`: Directory containing the sound effects and background music.\n- `Font/`: Directory containing the font file used in the game.\n\n## Future Improvements\n\n- Add more levels with increasing difficulty.\n- Implement different game modes (e.g., time attack, endless mode).\n- Enhance graphics and animations.\n- Add more sound effects and background music tracks.\n\n## Contributing\n\nContributions are welcome! Feel free to fork the repository and submit pull requests with your improvements and bug fixes.\n\n## License\n\nThis project is licensed under the MIT License. See the `LICENSE` file for details.\n\n## Disclaimer\n\nThis game is for educational purposes and personal enjoyment. Ensure you have the appropriate rights to use the graphic and sound assets included in the game.\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanishvedant%2Fsnake-game","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanishvedant%2Fsnake-game","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanishvedant%2Fsnake-game/lists"}