Pushbutton Engine and Haxe: a natural fit.

The Pushbutton Engine is an actionscript modular game engine and framework. It solves several problems that arise after the beginning stages of game development: object bloat, complexity management, and code reusability. This means that after some time adding all the behaviour needed by your game objects, e.g. a physics engine, controls, AI, rendering, sound etc, etc, it becomes more and more difficult to build code that is reusable, and managing object hierarchies becomes a giant pain. The Pushbutton Engine (PBE) avoids this trap by the use of components. The components defined in PBE communicate and integrate with one another via a a flexible system that avoids compile time dependencies, meaning that most of the time you can use someone else’s component without any modifications to the component source, and very little modification of your source (except of course the underlying game logic that uses that component).

A practical example. Say you design a 2D top down game. Later on, you decide that an isometric view is more suitable. That could involve a single line of code change, or a single modification to a level XML file. Unfortunately Pushbutton is written in actionscript (==Flash).

Step in HaXe. HaXe allows you to write in one language and compile to many others (currently, Flash, php, javascript, C++, neko). Compiling for multiple platforms is a huge plus, allowing a developer to write in one language and deploy the game on multiple platforms. Of course, deploying to multiple platforms means that certain low-level operations are unavoidably platform specific, notably loading resources, device input (mouse, touches, gestures, keyboard), and rendering. There are moves to unify the rendering (Jeash, NME) so that the flash rendering API works on the HTML5/javascript and C++ platforms identically, but this may not be optimal in all cases.

The modular, component based archituecture of PBE is a natural fit to HaXe. The platform specific parts can be written as components, allowing you to easily isolate these parts and swap them out depending on the platform.

So I’ve began porting PBE to Haxe. The git repository is here. I’m endevouring to keep as close to the original architecture as possible, however often to make a class or component more general than AS3 means a significant rewrite. At the very least, the core interfaces will be very similar if not the same.

In my next post I’ve documented some examples of compilation to different platforms (Flash, javascript+css, and javascript+HTML5 canvas).

There are many other good reasons to use the Pushbutton Engine, I would encourage you to check out the website.

This entry was posted in Flash/AS3, HaXe and tagged , , , , . Bookmark the permalink.

6 Responses to Pushbutton Engine and Haxe: a natural fit.

  1. Nate Beck says:

    Very cool stuff! Make sure you check out the BJG branch on google code, there are some drastic changes coming in PBE 2.0.

  2. Pingback: Unified game engine demos for flash, HTML5 (and more) | Dion Amago

  3. Pingback:  | Dion Amago

  4. theRemix says:

    i’ve never used pbe yet, and the hydrax project really sparks my interest in checking it out. <3 haXe

  5. Pingback: Pushbutton Engine and Haxe: a natural fit | CODE@蝴蝶。夢

  6. Kuba says:

    What is the current status of that port? Is it ready to create iOS/Android apps with haXe NME?

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>