Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
V8 / Allegro Game Engine Thing
C++
Branch: master
Failed to load latest commit information.
cmake Cleanup, fix some memory leaks and add functionality for full reloads…
src Cleanup, fix some memory leaks and add functionality for full reloads…
.gitignore Initial commit
CMakeLists.txt
LICENSE Initial commit
README.md Fix a segfault when loading of a module failed. Also added a very bas…

README.md

A very simple game engine built around Allegro and V8.

Build

You'll need cmake installed.

$ mkdir build
$ cd build
$ cmake ..
$ make
$ ./wombat ../game

You'll need Allegro 5 and libv8 to build wombat.

Scope

This is meant for creating simple 2D games which can - potentially - later on be ported to a compatible Web Version of the Engine.

TODO

  • a util.inspect equivilant
  • better stack traces
  • make hot code reloading work better
  • more graphic routines
  • utility for changing the window name etc.
  • storage abstraction

API

Note: Incomplete listing below.

Console

  • undefined log(...)

Game

  • object config

  • number getTime()

  • number getDelta()
  • boolean pause()
  • boolean resume()
  • boolean isPaused()
  • undefined reload()
  • boolean quit()

Keyboard

  • boolean isDown(number keyCode)
  • boolean wasPressed(number keyCode)
  • boolean wasReleased(number keyCode)
  • boolean isDown(number keyCode)
  • boolean hasFocus()
  • number getCount()

Mouse

  • boolean isDown(number button)
  • boolean wasPressed(number button)
  • boolean wasReleased(number button)
  • boolean isDown(number button)
  • boolean hasFocus()
  • number getCount()
  • object getPosition()

Graphics

  • undefined clear([number r, number g, number b, number a])
  • undefined setAutoClear(boolean enabled)
  • undefined render()

Image

  • boolean load(string image [, number cols, number rows])
  • undefined draw(string image, number x, number y [, bool flipHorizonal, bool flipVertical, number alpha])
  • undefined setTiled(string image, number cols, number rows)
  • undefined drawTiled(string image, number x, number y, number tileIndex [, bool flipHorizonal, bool flipVertical, number alpha])

Sound

  • boolean load(string sound)
  • boolean play(string sound [, number volume, number pan, number speed])

Music

  • boolean load(string music)
  • boolean play(string music)
  • boolean pause(string music)
  • boolean resume(string music)
  • boolean stop(string music)
  • boolean setVolume(string music, number volume)
  • boolean setPan(string music, number pan)
  • boolean setSpeed(string music, number speed)
Something went wrong with that request. Please try again.