Skip to content
Avetis edited this page Nov 6, 2015 · 10 revisions

Getting Started

This guide assumes that you already have experience with making a simple HelloWorld application using HaxelFlixel, if not, check out Getting Started with HaxeFlixel documentation, and then come back here.

Make sure you have this runtime added to your haxelib library list. You can either get the lastest developement branch from github which is master:

haxelib git overlap2d https://github.com/UnderwaterApps/overlap2d-runtime-haxeflixel master

or install latest stable release from haxelib

haxelib install overlap2d

This guide also assumes you have downloaded the Overlap2D editor, learned how to use it, and made a sample scene with some assets in it. If no - check out Editor Howto, and then come back here. (When creating your o2d project, give it size 600x480 and 1pixel per world unit, this is the default configuration of HaxeFlixel HelloWorld template, to makes thing easy for you)

Now that you have both HelloWorld application, and a ready to export O2D scene, use Export Settings to export your assets into your HaxeFlixel assets folder (make sure to clear it of other things first)

Awesome, we are ready to go! It's time to render the first scene.

Go to your MenuState.hx file, and in create method before the super, add the following lines:

    var sl:SceneLoader = new SceneLoader(); //loads your Overlap2D data
    sl.loadScene("MainScene"); // MainScene is the default scene.
    add(sl.getRoot()); // FlxSprite root element of scene.

Now just type in command line "lime test neko" or "lime test flash" to run your application. It should render your overlap2d scene exactly as it appears in the editor.

From this point, you can proceed to programming your game logic, and using special methods provided with runtime to manipulate the scene. Because it all consists from classical FlxSprite instances it should be as easy as in any regular HaxeFlixel app.

Time to learn some more tricks by visiting Navigating Items page.

Clone this wiki locally