-
Notifications
You must be signed in to change notification settings - Fork 6
Getting Started
This guide assumes that you already have experience with making a simple HelloWorld application using HaxelFlixel, if not, check out official:
Getting Started with HaxeFlixel documentation
And then come back here.
Make sure you have this runtime added to your haxelib library list by running this command:
haxelib git overlap2d https://github.com/UnderwaterApps/overlap2d-runtime-haxeflixel master
This guide also assumes you have made 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 raeady 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.