heaps-rpg

Top-down 2D RPG framework for Heaps.io
https://github.com/c-g-dev/heaps-rpg

To install, run:

haxelib install heaps-rpg 0.0.1 

See using Haxelib in Haxelib documentation for more information.

README.md

Heaps-RPG

A top-down 2D RPG framework for Heaps.io. Main features include:

  • Layer-based RPG maps
  • Map switching/warping
  • Overworld entity management
  • Grid walking
  • Controls
  • Collisions
  • Interacting
  • Events

Check the demo here: https://c-g-dev.github.io/heaps-rpg/

Concept

The engine is split between ROM and Runtime. The RPGROMData is the immutable "cartridge" containing all maps, objects, and game-specific logic. The Runtime classes are the internal state. Ideally, you just need to convert your game resources (JSON, .tmx, etc) into a RPGROMData instance, and then the engine will automatically handle the Runtime processing.

I am still trying to perfect the various system designs and RPG API's for this framework. Personally, I think it is a bit too complex and would benefit from some simplification, but the specifics of how it should be simplified are not immediately clear. If you have any opinions or suggestions, I would be thrilled to hear them.

High level example

//convert resources into a ROM data object
var rom = new RPGBuilder()
    //add layer and entity types
    .addEntityKind(new ChestKind())
    .addLayerKind(new SimpleTileLayerKind())
    //add maps
    .addMap("overworld", 20, 15, 16)
        .addLayer("ground", "tile", 0,  {/* layer data pulled from some file */})
    .endMap()
    .build();

//pass rom object into world
var world = new RPGWorld(rom);

s2d.addChild(world.viewport);

//set map and start
world.setMap("overworld");

Check the demo code for detailed examples.

Contributors
cgdev
Version
0.0.1
Published
11 months ago
Dependencies
License
MIT

All libraries are free

Every month, more than a thousand developers use Haxelib to find, share, and reuse code — and assemble it in powerful new ways. Enjoy Haxe; It is great!

Explore Haxe

Haxe Manual

Haxe Code Cookbook

Haxe API documentation

You can try Haxe in the browser! try.haxe.org

Join us on GitHub!

Haxe is being developed on GitHub. Feel free to contribute or report issues to our projects.

Haxe on GitHub