haxe toolkit and game development

21
Haxe Toolkit A multi-platform development solution by Romuald Halasz, 29.08.2014

Upload: romuald-halasz

Post on 25-Jun-2015

292 views

Category:

Software


8 download

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

Page 1: Haxe Toolkit and Game Development

Haxe ToolkitA multi-platform development solution

by Romuald Halasz, 29.08.2014

Page 2: Haxe Toolkit and Game Development

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

Page 3: Haxe Toolkit and Game Development

Presentation structure

Introduction to Haxe- language features

Cross-platform aspects- specific APIs,target specific platforms

Games- available tools, live demo

Page 4: Haxe Toolkit and Game Development

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

Page 5: Haxe Toolkit and Game Development
Page 6: Haxe Toolkit and Game Development

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

Page 7: Haxe Toolkit and Game Development

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!');

}

}

}

Page 8: Haxe Toolkit and Game Development

Language Architecture

- Haxe API- platform-specific APIs- libraries- frameworks

Page 9: Haxe Toolkit and Game Development
Page 10: Haxe Toolkit and Game Development

Haxe Standard Library

- general classes- system (requires platform compilation)- target specific APIs (cpp, cs, flash, php etc.)

Page 11: Haxe Toolkit and Game Development

Haxelib

- library manager- CLI tool- browse and download libraries: http://lib.haxe.org/

Page 12: Haxe Toolkit and Game Development

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

Page 13: Haxe Toolkit and Game Development

Focusing on Gamesavailable tools, the stack, frameworks

Page 14: Haxe Toolkit and Game Development

Light Media Engine - Lime

abstraction layer

one codebase for many cross-platform targets

available targets:Windows, Mac, Linux, iOS, Android, BlackBerry, Tizen, Emscripten, HTML5

Page 15: Haxe Toolkit and Game Development

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

Page 16: Haxe Toolkit and Game Development

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

Page 17: Haxe Toolkit and Game Development

OpenFl-compatible libraries

HaxeFlixel - Haxe port of FlixelHaxePunk - Haxe port of FlashPunkNape Physics Engine - 2D rigid body physicsBox2DActuate - tween animation libraryetc.

Page 18: Haxe Toolkit and Game Development

Available Editors and IDEs

FlashDevelopSublime Text - plugin availableIntelliJ IDEA - plugin available

Page 19: Haxe Toolkit and Game Development

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.)

Page 20: Haxe Toolkit and Game Development

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.

Page 21: Haxe Toolkit and Game Development

Thank you!...now on to the demo!