{"id":26186674,"url":"https://github.com/mariomarton/assembly-snake","last_synced_at":"2026-05-22T03:08:02.715Z","repository":{"id":279624774,"uuid":"939419085","full_name":"mariomarton/assembly-snake","owner":"mariomarton","description":"Two-player Snake game written in assembly language. Designed for the MIPS CPU architecture. Thanks to QTMips Online, it can be run in a web browser.","archived":false,"fork":false,"pushed_at":"2025-02-26T15:27:10.000Z","size":118,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-28T20:53:53.833Z","etag":null,"topics":["assembly","assembly-game","assembly-language","mips","mips-architecture","mips-assembly","qtmips","snake","snake-game","two-player-game"],"latest_commit_sha":null,"homepage":"","language":"Assembly","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/mariomarton.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-02-26T14:09:44.000Z","updated_at":"2025-02-27T15:21:28.000Z","dependencies_parsed_at":"2025-02-26T15:27:20.913Z","dependency_job_id":"2216438b-d500-455b-9bc9-01714f2b2a03","html_url":"https://github.com/mariomarton/assembly-snake","commit_stats":null,"previous_names":["mariomarton/assembly-snake"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/mariomarton/assembly-snake","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mariomarton%2Fassembly-snake","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mariomarton%2Fassembly-snake/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mariomarton%2Fassembly-snake/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mariomarton%2Fassembly-snake/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mariomarton","download_url":"https://codeload.github.com/mariomarton/assembly-snake/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mariomarton%2Fassembly-snake/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33326706,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-21T12:23:38.849Z","status":"online","status_checked_at":"2026-05-22T02:00:06.671Z","response_time":265,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["assembly","assembly-game","assembly-language","mips","mips-architecture","mips-assembly","qtmips","snake","snake-game","two-player-game"],"created_at":"2025-03-11T23:33:49.878Z","updated_at":"2026-05-22T03:08:02.695Z","avatar_url":"https://github.com/mariomarton.png","language":"Assembly","funding_links":[],"categories":[],"sub_categories":[],"readme":"# assembly-snake\n\nTwo-player Snake game written in assembly language. Designed for the MIPS CPU architecture. The entire game can be found in the [assembly-snake.S](assembly-snake.S) file. Thanks to [QTMips Online](https://comparch.edu.cvut.cz/qtmips/app/), you can try it out even in a web browser.\n\n\u003cimg src=\"doc-assets/snake-screen.jpg\" width=\"830\" height=\"auto\" style=\"border-radius: 11px;\" /\u003e\n\n## Running the Game\n\nThe game can be run using the QtMips tool, both in its [standard form](https://github.com/cvut/QtMips) and in the [web version](https://comparch.edu.cvut.cz/qtmips/app/).\nSet the QtMips options to correspond with the text below. Then, simply compile the file with the code and run it.\n\n#### QtMips Basic Options\n\n- No pipeline, no cache\n- Delay slot ON\n\n#### QtMips OS Emulation Options\n\u003cimg src=\"doc-assets/setup-parameters.jpg\" width=\"310\" height=\"auto\" style=\"border-radius: 5px;\" /\u003e\n\n## Game Behavior\n\n- _assembly-snake_ features two manually controlled snakes:\n  - **RED SNAKE** is controlled by:\n    - The red RGB knob or `WSAD` keys\n  - **BLUE SNAKE** is controlled by:\n    - The blue RGB knob or `IKJL` keys\n- On Game Over, the game intentionally breaks; please recompile to play again.\n- For food positions, pre-generated \"random\" positions are used. Optionally, the player can make the game more random by entering a `1-10` integer in the `OPTIONAL_NUMBER` constant at the start of the code (this changes the pre-generated positions).\n\n## Key Methods\n\nFor more detailed information, see the comments in the code.\n\n#### `drawPoint(address, color)`\n- A method with a nested for-loop that draws an 8x8 pixel square in the given color at the specified address.\n\n#### `drawSnake(length, address, direction, color)`\n- Draws the two snakes at initialization. Returns the snake’s head (`$a1`) and tail (`$a2`).\n\n#### `updateSnake(head, tail, snakeNumber, color, direction)`\n- Moves the snake by adding a new head and removing the old tail.\n  - Includes collision detection, extension when eating food, and more.\n  - Returns the updated head (`$a1`) and tail (`$a2`).\n\n#### `checkChange(tail, snakeNumber)`\n- Used inside `updateSnake()` to determine where the tail goes next.\n  - The addresses where the snake changes direction are saved in an array.\n  - This method looks for the (old) tail in the array to check if that is where the snake changed direction.\n\n#### `mainLoop()`\n- The **core game loop** that:\n  - Calls `updateSnake()` for both snakes.\n  - Checks and validates input from the keyboard and knobs.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmariomarton%2Fassembly-snake","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmariomarton%2Fassembly-snake","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmariomarton%2Fassembly-snake/lists"}