Skip to content
Joel Auterson edited this page Jul 28, 2016 · 10 revisions

28th July 2016 - Implement 'pixel mode'

Pixel mode tells the Screen to draw two 'pixels' to each terminal character, by use of the half-block Unicode character. To use, simply call the method on your Screen:

game.Screen().EnablePixelMode()

You should then treat the canvas as a normal canvas, albeit with twice the height, but only use the Bg field of cells. The 'Fg' field will be ignored.

27th November 2015 - Change Termbox input mode to Alt. Disable Esc key.

This change needed to be made due to idiosyncrasies with how escape sequences are handled by Termbox. The default exit key for a Termloop game is now Ctrl+C. A method, Game.SetEndKey(Key) has been added to allow this end key to be changed.

See #21 for more details.

4th November 2015 - Optional framerate limiting (via @jodizzle)

Framerate can now be optionally limited by calling:

Screen.SetFps(float64)

By default there is no framerate limit. Limiting the framerate may reduce unnecessary CPU usage, as most terminal emulators will have a hard-coded refresh rate anyway.

2nd October 2015 - Export Entities

The Entities slice in Screen and BaseLevel is exported. This could be used to, for example, reorder entities so that the Z-ordering can be controlled.

12th Sept 2015 - Added mouse input to events

Allows detection of mouse click events. Tested on OSX, should work on Linux - not a clue about Windows. [Edit: tested on Windows, working in both Command Prompt and ConsoleZ.]

Example added at _examples/click.go.

6th Sept 2015 - Added loading level maps from JSON strings

This allows a user to supply a JSON array of object attributes, which will be parsed into the level. It also allows users to define their own parsers for custom object types.

Additional changes:

  • The Level interface now also requires that the AddEntity(Drawable) and RemoveEntity(Drawable) methods be implemented.
  • Image processing has been altered - any pixels with transparency will be treated as fully transparent rather than fully opaque.

6th Sept 2015 - Changed structure of Game/Screen/Level hierarchy

To add a new Drawable, one must explicitly add it to either a Screen or a Level - one can no longer add it to a Game directly. For example:

game.AddEntity(entity)

will now be:

game.Screen().AddEntity(entity)

To add an Entity to the current Level of the Game's current Screen:

game.Screen().Level().AddEntity(entity)

5th Sept 2015 - Added entity creation from strings

A string can be provided to create a Canvas, and an Entity can be created using a Canvas. Newlines in the string are interpreted as a new row in the Canvas. This is useful if you want to store complex 'sprites' as text files.

4th Sept 2015 - Added audio playback, termloop/extra package

The Termloop extras package contains code which is dependant on some external dependencies. In the case of audio, PortAudio and libsndfile are required.