haxe toolkit and game development
DESCRIPTION
When developing applications which need to run on multiple platforms, one solution is to use the Haxe Toolkit. Haxe is a programming language designed to target multiple platforms with a single code base. OpenFl is the most widely used library for game development, available for Haxe. HaxePunk is Haxe port of the popular FlashPunk library.TRANSCRIPT
Haxe ToolkitA multi-platform development solution
by Romuald Halasz, 29.08.2014
A little bit about me
- started work with QuickBasic, BPascal, C++- Visual Studio 2005, OpenGL, DirectX- PHP, HTML, CSS, JavaScript- Flash, Flex- Haxe, NME, OpenFl- currently hosting TGD Meetup
Presentation structure
Introduction to Haxe- language features
Cross-platform aspects- specific APIs,target specific platforms
Games- available tools, live demo
Getting acquainted with Haxe
A bit of history:
22 October 2005 by French developer Nicolas Cannasse
Haxe 2.0 was released in July 2008,
Haxe 3 was released in May 2013
open source
Toolkit:
- language
- standard library
- compiler
Language Specifics
- based on ECMAScript standard, similar to ActionScript
- strictly typed
- object oriented
- conditional compilation (platform specific)
- inline calls
- metadata
- type params, constraints, variance
- etc. (pattern matching, abstract types, string interpolation …)
- more info: http://haxe.org/documentation/introduction/language-features.html
What does it look like ?class Test {
static function main():Void {
var people:Array = [
"Elizabeth" => "Programming",
"Joel" => "Design"
];
for (name in people.keys()) {
var job = people[name];
trace('$name does $job for a living!');
}
}
}
Language Architecture
- Haxe API- platform-specific APIs- libraries- frameworks
Haxe Standard Library
- general classes- system (requires platform compilation)- target specific APIs (cpp, cs, flash, php etc.)
Haxelib
- library manager- CLI tool- browse and download libraries: http://lib.haxe.org/
Targets and Use Cases
Name Kind Static typed Sys Use Cases
Flash byte code Yes No Games, Mobile
Neko byte code No Yes Web, CLI
ActionScript 3 source Yes Yes Games, Mobile, API
JavaScript source No No Web, Desktop, API
PHP source No Yes Web
C++ source Yes Yes Games, CLI, Mobile, Desktop
Java source Yes Yes CLI, Mobile, Desktop
C# source Yes Yes Mobile, Desktop
Python source No Yes CLI, Web, Desktop
Focusing on Gamesavailable tools, the stack, frameworks
Light Media Engine - Lime
abstraction layer
one codebase for many cross-platform targets
available targets:Windows, Mac, Linux, iOS, Android, BlackBerry, Tizen, Emscripten, HTML5
Lime - How does it work ?
Exposes:OpenGL, Audio, Input, windowing, native features
Stack:- CLI tools: manage build,package,install,run
- native layer: rendering,sound,platform core
(C++, Java and Objective-C)
- Haxe wrapper - exposes this functionality, abstract differences
OpenFl - Open Flash Library
Cross-platform Flash APIPowered by LimeHardware rendering, compiles to native C++Reaches more platforms than Adobe AIRHaxe as ActionScript 4Platforms:Windows,Mac,Linux,iOS,Android,BlackBerry,Tizen,HTML5,Firefox OS,Flash
OpenFl-compatible libraries
HaxeFlixel - Haxe port of FlixelHaxePunk - Haxe port of FlashPunkNape Physics Engine - 2D rigid body physicsBox2DActuate - tween animation libraryetc.
Available Editors and IDEs
FlashDevelopSublime Text - plugin availableIntelliJ IDEA - plugin available
HaxePunk Framework
OpenFl-based port of FlashPunkDesigned for gamesOpen-sourceFeatures- rendering: Image, SpriteMap, Canvas, Emitter, GraphicList etc.
- input: Keyboard, Mouse, Joystick, Multi-Touch
- tweens: Motion, Sound, Misc. (Angle, Color, Num, Var etc.)
Creating a new project
Creating the config file: XML- meta, window (w/h,fps), source(package,libs), assets path
Scenes- entity containers, switch between
Entities- primary actors, handle display, collision etc.
Thank you!...now on to the demo!