{"id":22293585,"url":"https://github.com/xi/survivor","last_synced_at":"2026-02-28T04:34:57.648Z","repository":{"id":150048428,"uuid":"603524798","full_name":"xi/survivor","owner":"xi","description":"graphical action game for the linux terminal","archived":false,"fork":false,"pushed_at":"2025-02-23T09:49:10.000Z","size":222,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-12T02:47:24.191Z","etag":null,"topics":["game","terminal-game"],"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/xi.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,"zenodo":null}},"created_at":"2023-02-18T19:20:29.000Z","updated_at":"2025-02-23T09:49:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"c430bf3a-286b-47d8-9836-639706a6fb04","html_url":"https://github.com/xi/survivor","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/xi/survivor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xi%2Fsurvivor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xi%2Fsurvivor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xi%2Fsurvivor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xi%2Fsurvivor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xi","download_url":"https://codeload.github.com/xi/survivor/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xi%2Fsurvivor/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29924752,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-27T19:37:42.220Z","status":"online","status_checked_at":"2026-02-28T02:00:07.010Z","response_time":90,"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":["game","terminal-game"],"created_at":"2024-12-03T17:29:44.825Z","updated_at":"2026-02-28T04:34:57.633Z","avatar_url":"https://github.com/xi.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Survivor\n\n![screenshot](./screenshot.png)\n\nSurvivor is a graphical action game for the Linux terminal. It is havily\ninspired by Vampire Survivors.\n\nThe player controls an automatically attacking character, with the goal to\nsurvive for as long as possible. At the start the character's only weapon is a\nshield that damages nearby enemies. Killed enemies drop diamonds that can be\ncollected to gain XP. When the blue XP bar at the top of the screen is full the\nplayer receives a random perk:\n\n-\tDamage is increased by 10%\n-\tMax health is increased by 10%\n-\tMovement speed is increased by 10%\n-\tShield radius is increased by 10%\n-\tPickup radius is increased by 10%\n-\tExperience from diamonds is increased by 10%\n-\tWeapon cooldown is decreased by 10%\n-\tFull health is restored\n-\tThe player recovers +0.2HP per second\n-\tGet an additional axe\n-\tGet an additional knive\n-\tGet an additional shuriken\n-\tGet an additional whirlwind\n\n## Installation\n\nThe game is written in rust and does not have any dependencies outside the\nstandard library and libc. You can run `cargo run` to build and execute it.\n\n## Controls\n\n-\tArrow keys / wasd / hjkl: move\n-\tSpace: stop moving\n-\tq: quit\n\n## Artwork\n\nThe sprites are based on artwork from [Vampires Dawn\n2](https://www.vampiresdawn.org/).\n\n## FAQ\n\n### Why did you do this?\n\nI had wanted to create a graphical action game for the terminal for a long\ntime. This kind of game felt like a good fit for the particular restrictions\nthat come with the terminal.\n\nAlso, Vampire Survivors takes a full minute to load and then full saturates the\nCPU on my laptop, even in the menu. I wanted to prove to myself that that is\nnot necessary.\n\n### Why does the character not stop when I release the movement keys?\n\nTerminals do not have a concept of key release events. That is actually a major\nreason why it is so hard to create games for the terminal. There are [proposals\nto add proper keyboard events](https://sw.kovidgoyal.net/kitty/keyboard-protocol/),\nbut so far they have not gained much traction.\n\n### Why are there so many graphical artifacts?\n\nEach cell of the terminal is subdivided into 2x3 pixels. This way we can get a\ndecent resolution. However, each cell can only have two colors. Artifacts\nhappen when the game tries to draw more then two colors into a single cell.\n\n### I get a bad frame rate. Is there anything I can do?\n\nThe game is designed to run on 30fps. The amount of computation that needs to\nbe done scales with the size of the window. So if you get a bad frame rate,\nthere is a good chance that it will improve if you reduce the window size.\n\n### Things are stretched in one direction, circles are ovals\n\nThe aspect ratio of pixels depends on the font. You can adjust\n`win::ASPECT_RATIO` to compensate for that.\n\n## Brief tour of the code\n\n-\t`src/main.rs` contains the main loop.\n-\t`src/game.rs` contains most of the game logic.\n-\t`src/input.rs`, `src/random.rs`, and `src/term,rs` wrap unsafe libc functions\n\tfor low level functionality.\n-\t`src/enemies.rs`  contains all the enemy types as well as the waves in which\n\tthey appear.\n-\t`src/sprites.rs` contains all graphics. The sprites are stored in\n\t[ppm](https://en.wikipedia.org/wiki/Netpbm_format) files and converted to\n\trust arrays by the `include_ppm!()` macro. That way all graphics are included\n\tin the binary. The color of the first pixel in a sprite is considered\n\ttransparent.\n-\t`src/win.rs` contains some drawing primitives as well as the conversion\n\tbetween logical positions and screen pixels.\n\nMost game logic is expressed as `f32`. Positions represet the logical center of\nobjects. When drawing to the screen, the `f32` positions are converted to\n`usize` pixels. Game logic is mostly independent of pixels though. The only\nexceptions are that enemy spawn and despawn outside of the screen, so they\ndepend on the screen size.\n\n## TODO (patches welcome)\n\n-\tLet the player pick a perk on level up\n-\tImprove balancing\n-\tAdd tarain\n-\tMore enemy waves\n-\tSound\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxi%2Fsurvivor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxi%2Fsurvivor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxi%2Fsurvivor/lists"}