{"id":18771525,"url":"https://github.com/ssusnic/ascii-snake","last_synced_at":"2025-10-23T18:06:29.406Z","repository":{"id":111157138,"uuid":"479443105","full_name":"ssusnic/ASCII-Snake","owner":"ssusnic","description":"A repository that contains the source code of my terminal based Snake game written in C++ for the Windows Command Line.","archived":false,"fork":false,"pushed_at":"2022-04-20T09:31:04.000Z","size":311,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-29T08:11:46.164Z","etag":null,"topics":["2d","2d-game","ascii","command-line","commandprompt","cplusplus","cpp","game-development","game-programming","gamedev","making-games","mingw","mingw-w64","snake","snake-game","terminal-based","terminal-game","text-based-game","visual-studio","vscode"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ssusnic.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-04-08T15:25:54.000Z","updated_at":"2023-04-25T02:05:50.000Z","dependencies_parsed_at":"2024-03-16T20:18:11.764Z","dependency_job_id":null,"html_url":"https://github.com/ssusnic/ASCII-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/ssusnic%2FASCII-Snake","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssusnic%2FASCII-Snake/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssusnic%2FASCII-Snake/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssusnic%2FASCII-Snake/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ssusnic","download_url":"https://codeload.github.com/ssusnic/ASCII-Snake/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239679403,"owners_count":19679469,"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":["2d","2d-game","ascii","command-line","commandprompt","cplusplus","cpp","game-development","game-programming","gamedev","making-games","mingw","mingw-w64","snake","snake-game","terminal-based","terminal-game","text-based-game","visual-studio","vscode"],"created_at":"2024-11-07T19:25:12.715Z","updated_at":"2025-10-23T18:06:24.038Z","avatar_url":"https://github.com/ssusnic.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ASCII Snake for Windows Console\n\nThis repository contains the source code of my terminal based **Snake** game written in **C++** for the **Windows Command Line**.  \n\nThe game is primarily developed with **MinGW** development tools using the **GCC** compiler and is available in the **Snake_MinGW** folder.\n\nBut if you rather prefer Visual Studio than MinGW to compile your C++ projects, then lucky you!  \nThere is also a **Visual Studio** solution of the Snake game availaible in the **Snake_VS** folder.\n\nYour task is to move the snake with the cursor keys, and eat as much food as possible before you die of insatiable greed. The snake earns points with each item eaten, but it also gets longer as a result of enormous gluttony. The game is over when the snake runs into itself, or hits the border walls.  \n\nWatch the Video Tutorial:  \n\n[![Watch Video!](https://github.com/ssusnic/ASCII-Snake/raw/main/thumb_snake_720x480.png)](https://www.youtube.com/watch?v=ivxeUwFvjow \"Watch Video!\")\n\n\n## Terminator Framework\n\nTo make this game, I used my own game framework called **Terminator**, which provides a set of specific functions needed for developing terminal based games in Windows Console as follows:  \n\n  - creating and destroying console window\n  - tracking time to ensure refreshing at proper frames per second\n  - drawing characters, text and rectangles\n  - clearing and redrawing the screen\n  - playing sounds\n\nThe framework is consisted of the following files:\n  - ```Terminator.h``` - header file\n  - ```Terminator.lib``` - static library\n  - ```Terminator.dll``` - dynamic library\n\nSince the binary files generated with different C++ compilers are in general not link compatible, there are special versions of the Terminator framework generated for using with MinGW and Visual Studio.\n\n\n## Building the game with MinGW\n\n1. install MinGW development tools (https://www.mingw-w64.org/) \n2. download the MinGW project from the **Snake_MinGW** folder \n3. build the game:  \n    a) dynamically by running this command:\n      ```shell\n      g++ Snake.cpp Terminator.dll -o Snake.exe -DUNICODE -O3 -lwinmm\n      ```\n    b) statically by running this command:  \n      ```shell\n      g++ Snake.cpp Terminator.lib -o Snake.exe -DUNICODE -O3 -lwinmm -DSTATIC_LIB -static  \n      ```\n    c) by using the make.bat script and running the following commands:  \n      ```make -d``` to build dynamically  \n      ```make -s``` to build statically  \n\n\n## Building the game with Visual Studio\n\n1. install MS Visual Studio (https://visualstudio.microsoft.com/)  \n2. download the Visual Studio solution from the **Snake_VS** folder  \n3. open **Snake.sln** in MS Visual Studio\n4. select the Solution Configuration (Debug/Release)\n5. select the Solution Platform (x64/x86)\n6. choose the Build Solution command to build the game\n\n\n## License notice\n\nCopyright (C) 2022 Ask For Game Task\n\nAll programs in this repository are protected by GNU General Public License version 3.  \nIf you use them, you must attribute me.\n\nEach program in this repository is free software: \nyou can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.\n\nEach program in this repository is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. \n\nSee the LICENSE file for more details on the GNU General Public License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fssusnic%2Fascii-snake","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fssusnic%2Fascii-snake","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fssusnic%2Fascii-snake/lists"}