Don't Fly Into a F***ing Asteroid!!!


Don't Fly Into a F***ing Asteroid!!! is a very simple space flight game inspired by the classical video game, Asteroids. The game puts you in control of a space ship which moves through outter space using thrust. Thrust is applied directionally using prescribed keyboard keys as follows: Thrusting in any direction increases the velocity in said direction by 1 unit and is cumulative with multiple keystrokes. It is worth noting that your ship can go "off-screen" indefinitely in any direction. If this happens and you can't find your way back, the V key will place your ship back into default position. Also, stopping or reversing direction requires "undoing" the amount of thrust you've already invested in your current direction(s). For example, if you thrusted upwards by pressing the E key three times, you'd have to press the D key three times to stop or more than three times to undo upward thrust and begin moving downwards. For convenience, I've included the X key which cancels thrust in all directions and stops your ship from moving. This is especially handy when you've accidently applied too much thrust and lost your ship offscreen. If you were to only press V key, then your ship would relocate to default position, but the large thrust values would likely result in, once again, your ship flying offscreen. Using the X key to cancel all thrust and then the V key to relocate the ship is recommended in these cases.

Setting Up And Playing The Game

The game uses jgraph to continuously overwrite a jpg file with the visual state of the game. As such, it is vitally important to find a way to view a single jpg file which updates the view when the file changes. If you want to install jgraph locally, you can follow the link to obtain the source files, or you can remote into the UTK lab computers which already have jgraph installed. The following instructions are for playing remotely, but these can easily be adjusted to play locally.

INSTRUCTIONS
  1. Download and install VSCode if you don't have it already.

  2. Remote-in to one of the UTK's lab computers.

  3. Use VSCode's explorer to find the game's main directory (/home/jplank/www-home/plank/classes/cs494/494/labs/Lab-3-Jgraph).

  4. Open "jimage.jpg" in it's own VSCode window. This window will act as your gaming screen.

  5. The game is played using the console so you can either use VSCode's built-in terminal or a separate program. I prefer using VSCode in conjunction with MobaXterm for some strange reason.
    To start the game, simply enter the following console command in the game's main directory:

    ./jgraph

    The game will print out an introduction and instructions with the game paused. Once you're ready, hit Q key to unpause and play.

Example Gameplay Video

Below is a video showing a short segment of gameplay. And yes, I know the collision logic is horrendous, but it gets the point across ;). Enjoy!