Menu

Tree [ea56e4] master /
 History

HTTPS access


File Date Author Commit
 libforthgame2d 2019-09-23 Paul Osmialowski Paul Osmialowski [ea56e4] editor: fix nasty leak in editor toolbar
 libleveleditor2d 2019-04-17 Paul Osmialowski Paul Osmialowski [9005cb] Initial commit
 AUTHORS 2019-04-17 Paul Osmialowski Paul Osmialowski [9005cb] Initial commit
 Makefile 2019-04-17 Paul Osmialowski Paul Osmialowski [9005cb] Initial commit
 README.md 2019-04-17 Paul Osmialowski Paul Osmialowski [9005cb] Initial commit
 arrow-left.svg 2019-04-17 Paul Osmialowski Paul Osmialowski [9005cb] Initial commit
 arrow-right.svg 2019-04-17 Paul Osmialowski Paul Osmialowski [9005cb] Initial commit
 arrow.svg 2019-04-17 Paul Osmialowski Paul Osmialowski [9005cb] Initial commit
 ball-left.svg 2019-04-17 Paul Osmialowski Paul Osmialowski [9005cb] Initial commit
 ball-right.svg 2019-04-17 Paul Osmialowski Paul Osmialowski [9005cb] Initial commit
 ball.svg 2019-04-17 Paul Osmialowski Paul Osmialowski [9005cb] Initial commit
 bricks.svg 2019-04-17 Paul Osmialowski Paul Osmialowski [9005cb] Initial commit
 exit-gray.svg 2019-04-17 Paul Osmialowski Paul Osmialowski [9005cb] Initial commit
 exit-white.svg 2019-04-17 Paul Osmialowski Paul Osmialowski [9005cb] Initial commit
 forthgame.conf 2019-04-17 Paul Osmialowski Paul Osmialowski [9005cb] Initial commit
 level1.conf 2019-04-17 Paul Osmialowski Paul Osmialowski [9005cb] Initial commit
 make.def 2019-04-17 Paul Osmialowski Paul Osmialowski [9005cb] Initial commit
 pause.svg 2019-04-17 Paul Osmialowski Paul Osmialowski [9005cb] Initial commit
 play.svg 2019-04-17 Paul Osmialowski Paul Osmialowski [9005cb] Initial commit
 redx.svg 2019-04-17 Paul Osmialowski Paul Osmialowski [9005cb] Initial commit
 save-gray.svg 2019-04-17 Paul Osmialowski Paul Osmialowski [9005cb] Initial commit
 save-white.svg 2019-04-17 Paul Osmialowski Paul Osmialowski [9005cb] Initial commit
 stop.svg 2019-04-17 Paul Osmialowski Paul Osmialowski [9005cb] Initial commit

Read Me

Forthgame2d

This repository contains source code of following two libraries:

  • libforthgame2d - a simple 2D game engine,
  • libleveleditor - an level editor engine for simple 2D game.

This code is an example use of the Forthlang compiler. Not perfect,
bit messy and full of experimental features exposing various sometimes
unexpected ways of using Forthlang.

Building it

First, you need to build Forthlang compiler and make it visible
(as forthlang command) to your command line. The compiler also
needs to be able to find header files for the libforthlang library
and the linker needs to be able to easily find it.

Simple Makefile is provided and should be sufficient in most cases.
No install target is provided.

The Makefile includes the make.def file where you can tweak your build
time configuration.

Provided make.def file makes use of GNU-compatible readlink command.
This can be problematic on systems where readlink command is not
GNU-compatible (e.g. MacOSX). In such circumstances, GNU equivalent
(greadlink) needs to be installed (e.g. from MacPorts). A building
process started with gmake command (instead of make) results in
greadlink being used instead of readlink.

Running example game

Along with the two libraries, forthgame2d executable binary is also
built. When started with no command line parametes, it just starts
a simple game. Available command line parameters are:

  • forthgame2d [width] [height] - start a game with given SDL window size,
  • forthgame2d [level] - start level editor and open a level specified as
    1-based integer number,
  • forthgame2d [level] [width] [height] - same as above, with given SDL
    window size.