{"id":13681609,"url":"https://github.com/soupi/sdl2-snake","last_synced_at":"2025-08-25T01:14:04.421Z","repository":{"id":150257289,"uuid":"134064052","full_name":"soupi/sdl2-snake","owner":"soupi","description":"An example application for sdl2.","archived":false,"fork":false,"pushed_at":"2022-02-19T09:11:20.000Z","size":135,"stargazers_count":26,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-03T19:39:11.433Z","etag":null,"topics":["example","game","haskell","sdl2","snake"],"latest_commit_sha":null,"homepage":"","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/soupi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-05-19T13:23:42.000Z","updated_at":"2024-03-31T21:14:05.000Z","dependencies_parsed_at":"2023-04-14T17:41:28.045Z","dependency_job_id":null,"html_url":"https://github.com/soupi/sdl2-snake","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soupi%2Fsdl2-snake","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soupi%2Fsdl2-snake/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soupi%2Fsdl2-snake/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soupi%2Fsdl2-snake/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/soupi","download_url":"https://codeload.github.com/soupi/sdl2-snake/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250790030,"owners_count":21487729,"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":["example","game","haskell","sdl2","snake"],"created_at":"2024-08-02T13:01:32.994Z","updated_at":"2025-04-25T09:31:22.397Z","avatar_url":"https://github.com/soupi.png","language":"Haskell","funding_links":[],"categories":["Haskell"],"sub_categories":[],"readme":"# Snake\n\nThis is an example application for [sdl2](https://hackage.haskell.org/package/sdl2).\n\nClick on the SDL module in the link for a tutorial on how to get started with sdl2.\n\n## Gameplay\n\n![Gameplay gif](gameplay.gif)\n\n## Build and Run\n\n### Prerequisites\n\nYou will need to install [Stack](https://haskellstack.org).\n\nYou will also need sdl2 libraries:\n\n\u003e Note: You don't have to install ttf, image and mixer for this snake game to work, but you might want to use fonts, images and sounds later.\n\n#### Ubuntu\n\n```sh\nsudo apt install libsdl2-dev libsdl2-ttf-dev libsdl2-image-dev libsdl2-mixer-dev\n```\n\n#### OS X\n\n```sh\nbrew install sdl2 sdl2_ttf sdl2_image sdl2_mixer\n```\n\n#### Windows\n\n```sh\nstack exec -- pacman -Syu\nstack exec -- pacman -S mingw-w64-x86_64-pkg-config mingw-w64-x86_64-SDL2 mingw-w64-x86_64-SDL2_image mingw-w64-x86_64-SDL2_ttf mingw-w64-x86_64-SDL2_mixer\n```\n\n### Build and Run\n\n#### Stack\n\n```sh\nstack build \u0026\u0026 stack exec app\n```\n\n## Want to tinker with this game? Here are a few ideas\n\n- Do nothing when the user tries to move to the direction the snake is coming from instead of failing\n- Change the snake's speed\n- Add a key to restart the game\n- Keep score and report to the user\n- Add obstacles\n- Play a sound when the snake eats the apple\n- Report game over to the game window instead of to the console\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoupi%2Fsdl2-snake","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsoupi%2Fsdl2-snake","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoupi%2Fsdl2-snake/lists"}