Skip to content

razterizer/Asciiroids

Repository files navigation

Asciiroids

GitHub License Static Badge

build ubuntu build macos build windows Valgrind Status

Top Languages GitHub repo size C++ LOC Commit Activity Last Commit Contributors

GitHub Downloads (all assets, all releases)

Asciiroids 25fps 2 image

About the Game

A cross-platform (Lin/Mac/Win) terminal-based shooter game.

Relive the old Atari Asteroids arcade game from 1979 with this clone. It gets even better, because this game allow you to play it directly on your favourite terminal (emulator) or windows console.

This Termin8or-based game uses a vector based sprite for the spaceship and bitmap based sprites for asteroids, UFOs and explosion animations. It uses the Termin8or CollisionHandler for collisions between asteroids <-> spaceship and UFOs <-> spaceship. 8Beat is used for "music" playback and SFX generation and playback.

I hope this game will give you much joy and fun.

Keys

  • , a : Turn Left.
  • , d : Turn Right.
  • , w : Thrust.
  • [space] : Fire.
  • [backspace], h : Hyperspace.

Build & Run Instructions

There are two options on dealing with repo dependencies:

Repo Dependencies Option 1

This method will ensure that you are running the latest stable versions of the dependencies that work with Asciiroids.

The script fetch-dependencies.py used for this was created by Thibaut Buchert. fetch-dependencies.py is used in the following scripts below:

After a successful build, the scripts will then prompt you with the question if you want to run the program.

When the script has been successfully run for the first time, you can then go to sub-folder Asciiroids and use the build.sh / build.bat script instead, and after you have built, just run the run.sh or run.bat script.

Windows

Run the following script:

setup_and_build.bat

MacOS

Run the following script:

setup_and_build_macos.sh

Linux (Debian-based, e.g. Ubuntu)

Run the following script:

setup_and_build_debian.sh

Repo Dependencies Option 2

In this method we basically outline the things done in the setup_and_build-scripts in Option 1.

This method is more suitable for development as we're not necessarily working with "locked" dependencies.

You need the following header-only libraries:

Make sure the folder structure looks like this:

<my_source_code_dir>/lib/Core/                      ; Core repo workspace/checkout goes here.
<my_source_code_dir>/lib/Termin8or/                 ; Termin8or repo workspace/checkout goes here.
<my_source_code_dir>/lib/8Beat/                     ; 8Beat repo workspace/checkout goes here.
<my_source_code_dir>/lib/AudioLibSwitcher_applaudio ; AudioLibSwitcher_applaudio repo workspace/checkout goes here.
<my_source_code_dir>/lib/TrainOfThought             ; TrainOfThought repo workspace/checkout goes here.
<my_source_code_dir>/lib/applaudio                  ; applaudio repo workspace/checkout goes here.
<my_source_code_dir>Asciiroids/                     ; Asciiroids repo workspace/checkout goes here.

These repos are not guaranteed to all the time work with the latest version of Asciiroids. If you want the more stable aproach then look at Option 1 instead.

Windows

Then just open <my_source_code_dir>/Asciiroids/Asciiroids/Asciiroids.sln and build and run. That's it!

You can also build it by going to <my_source_code_dir>/Asciiroids/Asciiroids/ and build with build.bat. Then you run the game by typing run.bat.

MacOS

Go to <my_source_code_dir>/Asciiroids/Asciiroids/ and build with ./build.sh.

Then run by typing ./bin/asciiroids.

Linux

Go to <my_source_code_dir>/Asciiroids/Asciiroids/ and build with ./build.sh.

Then run by typing ./bin/asciiroids.

Make New Release

Trigger new release. For example:

git tag release-1.0.0.0
git push origin release-1.0.0.0

If release workflow failed, you can delete the tag and add it again which then retriggers the release workflow. For example::

# Delete local tag
git tag -d release-1.0.0.0

# Delete remote tag
git push --delete origin release-1.0.0.0

# Re-create the tag locally
git tag release-1.0.0.0

# Push the tag again (this retriggers the workflow)
git push origin release-1.0.0.0

But it is best to use the script retag_release.sh for such tasks. E.g.:

./retag_release bump patch "Some tag message."

or e.g.:

./retag_release 1.1.5.7 "Some tag message."

Note that the tag message is currently not used as release notes, but the last commit message is. I will change this in the future.

Running from a Release

When you download a MacOS release then you need to tell the gatekeeper unblock the executable (here: asciiroids), but only if you trust the program of course (check source code + release workflow if you're unsure). When you feel ready, you can allow the binary to be run by going to the release folder and type the following:

xattr -dr com.apple.quarantine asciiroids

On Windows, you might have to unblock the exe by right-clicking the exe-file and check the Unblock checkbox.