{"id":26469795,"url":"https://github.com/ocdbytes/rsnake","last_synced_at":"2025-03-19T17:09:25.511Z","repository":{"id":192167813,"uuid":"672077740","full_name":"ocdbytes/rsnake","owner":"ocdbytes","description":"Snake Game : Rust 🐍","archived":false,"fork":false,"pushed_at":"2023-09-02T01:55:17.000Z","size":356,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-04-14T10:46:09.524Z","etag":null,"topics":["piston-window","rust","standard-library"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/ocdbytes.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}},"created_at":"2023-07-28T21:36:35.000Z","updated_at":"2023-09-02T01:56:48.000Z","dependencies_parsed_at":"2023-09-03T04:13:20.220Z","dependency_job_id":"30f361c4-186e-4e0c-979f-3b8355188ab0","html_url":"https://github.com/ocdbytes/rsnake","commit_stats":null,"previous_names":["arun89-crypto/rsnake"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ocdbytes%2Frsnake","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ocdbytes%2Frsnake/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ocdbytes%2Frsnake/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ocdbytes%2Frsnake/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ocdbytes","download_url":"https://codeload.github.com/ocdbytes/rsnake/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244470251,"owners_count":20457908,"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":["piston-window","rust","standard-library"],"created_at":"2025-03-19T17:09:24.974Z","updated_at":"2025-03-19T17:09:25.505Z","avatar_url":"https://github.com/ocdbytes.png","language":"Rust","readme":"# RSnake\n\nSnake game made in rust lang using `piston_window` game engine.\n\n![screenshot](./docs/1.png)\n\n## File Structure\n\n```sh\n---- /src\n|    - draw.rs\n|    - game.rs\n|    - snake.rs\n|    - main.rs\n---- /target\n---- Cargo.toml\n---- config.json\n---- score.txt\n---- Readme.md\n```\n\n- `draw.rs` : This file contains all the functions that allow to create the block and rectangle using the piston_window library.\n- `game.rs` : This file contains all the functions that are related to Game and it also contains the functions to check the snake state.\n- `snake.rs` : This file contains all the functions related to updating the state of the snake and checking the current state.\n- `main.rs` : This file contains all the main functions to init the game and make the canvas to render a window.\n- `config.json` : This file contains the config for the game.\n- `score.txt` : This file tracks the score.\n\n**CONFIG file :**\n\n```json\n{\n  \"food_exists\": \"true\",\n  \"moving_period\": \"0.1\",\n  \"restart_time\": \"1.0\"\n}\n```\n\n1. food_exists : Initiate food in game or not.\n2. moving_period : Game speed.\n3. restart_time : Time after that game will restart after the `game_over`.\n\n## Build\n\n```sh\ncargo update\ncargo build\n```\n\n## Run\n\n```sh\ncargo run\n```\n\n## Libraries\n\nPiston Window\n\n- \u003chttps://docs.rs/piston_window/latest/piston_window/\u003e\n\nRand\n\n- \u003chttps://docs.rs/rand/0.8.5/rand/\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Focdbytes%2Frsnake","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Focdbytes%2Frsnake","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Focdbytes%2Frsnake/lists"}