{"id":23890412,"url":"https://github.com/akshitmunjal/snake_game_python","last_synced_at":"2025-10-28T16:18:24.505Z","repository":{"id":270391756,"uuid":"910244806","full_name":"AkshitMunjal/Snake_Game_Python","owner":"AkshitMunjal","description":"A classic Snake Game🐍🎮 built in Python using the turtle module. Control the snake, eat the food, and try to beat the high score! The game features a scoreboard, persistent high score tracking, and collision detection for an engaging gameplay experience.","archived":false,"fork":false,"pushed_at":"2024-12-30T19:34:29.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-30T20:25:33.515Z","etag":null,"topics":["game-development","jupyter-notebook","object-oriented-programming","pycharm-ide","python3","turtle-python"],"latest_commit_sha":null,"homepage":"https://padlet.com/akshitmunjal479/projects-portfolio-ozbg80dvuk6fl9gg","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AkshitMunjal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-30T19:22:37.000Z","updated_at":"2024-12-30T19:34:33.000Z","dependencies_parsed_at":"2024-12-30T20:25:43.660Z","dependency_job_id":"884deaf4-4de7-4df0-a492-ebdd7cb61af1","html_url":"https://github.com/AkshitMunjal/Snake_Game_Python","commit_stats":null,"previous_names":["akshitmunjal/snake_game_python"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AkshitMunjal%2FSnake_Game_Python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AkshitMunjal%2FSnake_Game_Python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AkshitMunjal%2FSnake_Game_Python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AkshitMunjal%2FSnake_Game_Python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AkshitMunjal","download_url":"https://codeload.github.com/AkshitMunjal/Snake_Game_Python/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240271539,"owners_count":19774859,"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":["game-development","jupyter-notebook","object-oriented-programming","pycharm-ide","python3","turtle-python"],"created_at":"2025-01-04T11:07:04.969Z","updated_at":"2025-10-28T16:18:24.368Z","avatar_url":"https://github.com/AkshitMunjal.png","language":"Python","readme":"\n# Snake Game Project\n\nThis is a simple Snake Game implemented in Python using the turtle module. The game involves controlling a snake to eat food while avoiding collision with walls and itself. Each time the snake eats food, it grows longer and the player's score increases.\n\n\n## Features\n\n🐍Snake Movement: Use arrow keys to control the snake's direction (Up, Down, Left, Right).\n\n🍊Food Generation: Randomly placed food on the screen that the snake eats.\n\n📑Scoreboard: Displays the current score and the high score.\n\n🔝High Score Tracking: Stores the high score in a text file (data.txt) that persists between game sessions.\n\n👉Collision Detection: Ends the game if the snake hits the wall or itself, and resets the game.\n\n\n\n\n## How to Run\n\n1. Clone this repository to your local machine.\n\n2. Ensure you have Python installed (preferably version 3.6 or higher).\n\n3. Run the main.py file to start the game:\n    pythonmain.py\n\n4. Use the arrow keys to control the snake and start playing.\n## File Structure\n\nSnake_Game_Project/\n\n├── food.py          # Manages the food creation and                  random positioning.\n\n├── main.py          # Main game logic and event listeners.\n\n├── scoreboard.py    # Handles scoring and high score persistence.\n\n├── snake.py         # Implements snake behavior and controls.\n\n├── data.txt         # Stores the high score.\n## Dependencies\n\n✔️Python: Make sure Python is installed on your system.\n\n✔️turtle: Comes pre-installed with Python, so no additional installation is required.\n\n✔️random: Python's built-in library for random number generation.\n\n\n## Code Explanation\n\n\n🍊food.py\n\nHandles the food creation and positioning:\n\nUses a small blue dot as food.\n\nRandomly places the food on the screen whenever it is eaten.\n\n🧑‍💻main.py\n\nControls the overall game loop and screen setup:\n\nInitializes the screen, snake, food, and scoreboard.\n\nSets up keyboard listeners for snake movement.\n\nContains the main game loop for collision detection and game updates.\n\n\n📑scoreboard.py\n\nManages scoring and high score tracking:\n\nDisplays the current score and the high score.\n\nUpdates the high score in data.txt after each game.\n\n🐍snake.py\n\nImplements the snake's behavior:\n\nCreates the snake and handles its movement.\n\nDetects collisions and resets the game when necessary.\n\nGrows the snake when it eats food.\n## Controls\n\n👆Up: Move the snake upward.\n\n👇Down: Move the snake downward.\n\n👈Left: Move the snake to the left.\n\n👉Right: Move the snake to the right. \n\n\n![image alt](https://github.com/AkshitMunjal/Snake_Game_Python/blob/a3f6dbd98724d5439ab2dc6ce5019c2caa4d464a/Snake_Game.png)\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakshitmunjal%2Fsnake_game_python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakshitmunjal%2Fsnake_game_python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakshitmunjal%2Fsnake_game_python/lists"}