CS-Journeys / AsciiEngine

Game engine for building command-line, ascii art games
GNU General Public License v3.0
3 stars 0 forks source link

Engine Labels #2

Open lukalelovic opened 3 years ago

lukalelovic commented 3 years ago

It might sound silly to think of a user interface inside of a command-line game engine, but what this really means is just the ability to have some text prompted inside of the game. This can be simply done by outputting some regular text below or above the game scene.

How this can be done:

  1. A text/label object class (which would likely inherit from the GameObject class)
  2. When the user wants a new text or label, he creates a new object of the label class which is initialized or assigned to some text
  3. A draw function will then draw the text above or below the game window

Why this is necessary: Most games need instructions for their players. Otherwise, it is unclear what the player is supposed to do.

Other potential features: The player might want the game to be paused, and the player to be prompted, when a set of text shows up (such as a popup dialog box). This means the behavior of the labels can vary. This should be taken into account when creating a text/label class