Skip to content

Repository files navigation

TermFormer: A Terminal Platformer

wakatime language creator creator

A terminal platformer game & level editor built using python and the asciimatics library (mainly as a proof of concept).

About

Originally built as a capstone project for a computer programming class, this project has turned into an exploration of the possibilities of terminal games, even in popular genres like platformers.

In the main game, the user controls an o, trying to make their way to a flag, avoiding spikes and traps along the way. For controls, see Gameplay Controls.

The Level Editor includes 5 different tools (pen, dropper, spike, spawn position, and flag), 256 colours (found here) for both the foreground and the background, save slots, and more! For help with controls, see Level Editor Controls.
These levels are loadable straight from the editor to the main game, with zero hassle. Just navigate to the main menu, select Play Custom Level, and choose the correct slot.

Saw this cool video the other day which highlights other possibilities for this type of project: Minecraft, but it runs in the terminal

Example

Gameplay:

Watch gameplay

gameplay.mp4

Level Editor:

Watch level editor

level_editor.mp4

Loading Level:

Watch custom level

custom_level.1.mp4

Necessary Libraries

Controls

Gameplay:

  • Use WASD and Space to move
  • Press Q or ESC to pause
  • Use Arrow Keys (↑/↓) and Enter to navigate menus

Level Editor

  • Press H to see the help menu
  • Click or Drag to draw
  • Press S to save (save indicator appears at the bottom of the editor)
  • Press Enter to change pen colour
  • Press B to change background colour
  • Press Space to shuffle through tools
  • Use keys 1-5 to select specific tools
  • Use ESC (or the key used to open the popup) to close menus

Tool Types

Tool Description
Pen Draws blocks on the screen. Uses pen colour (enter to change). If colour is the same as the background, it will erase blocks.
Dropper Selects colour from anywhere on the screen.
Spike Draws spikes on the screen. Uses pen colour (enter to change).
Spawn position Changes the character's spawn position.
Flag Changes the flag's position.

Ideas

  • Enemies
  • Add abilities
    • dash left or right
  • Bounce pads
  • Secrets / Easter Eggs
  • Add multiple levels to the main game
  • Add shadows??
  • Add settings (to toggle music on/off, change controls)
  • Add my own music?
  • Add a better way to close the game than ctrl + c

Notes

Warning

This project has not been tested on windows or linux devices!

  • This project was created using the asciimatics package, but might have been better suited for another package like blessed.
    • As asciimatics is better for animations and other projects, blessed, which is lower-level with fewer built-in features, would likely have been better for this project
  • Using the ESC key will often have a delayed response, as terminals wait briefly to check if it is part of an escape sequence.
  • Chart of all valid terminal colours: color chart
  • Level data in the JSON files could be optimized to reduce size and increase performance.
  • Testing had not been done on Windows or Linux systems
  • It is likely buggy, as I am the only one testing this
  • There are many learning opportunities to make it better
    • Should have rewritten the popup_creator.add_coloured_text and popup_creator.add_text functions to be more similar in how they are called
    • Should have made the base popup class better to avoid repeated code
    • Could have cleaned up the main game and level editor files
  • Adjusting screen size while playing / editing will reset everything!

About

ASCII Terminal Platformer

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages