-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 7831f17
Showing
108 changed files
with
5,593 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
bin | ||
unoptimized assets | ||
/*.keystore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<project version="2"> | ||
<!-- Output SWF options --> | ||
<output> | ||
<movie outputType="Application" /> | ||
<movie input="" /> | ||
<movie path="application.xml" /> | ||
<movie fps="60" /> | ||
<movie width="800" /> | ||
<movie height="480" /> | ||
<movie version="3" /> | ||
<movie minorVersion="0" /> | ||
<movie platform="NME" /> | ||
<movie background="#000000" /> | ||
<movie preferredSDK=";3;" /> | ||
</output> | ||
<!-- Other classes to be compiled into your SWF --> | ||
<classpaths> | ||
<class path="src" /> | ||
<class path="bin\windows\cpp\haxe" /> | ||
</classpaths> | ||
<!-- Build options --> | ||
<build> | ||
<option directives="tools=1.3.1
lime_native
no-compilation
display
windows
desktop" /> | ||
<option flashStrict="False" /> | ||
<option noInlineOnDebug="False" /> | ||
<option mainClass="ApplicationMain" /> | ||
<option enabledebug="True" /> | ||
<option additional="--no-output
--macro allowPackage('flash')
--macro keep("RaiderWings")" /> | ||
</build> | ||
<!-- haxelib libraries --> | ||
<haxelib> | ||
<library name="openfl" /> | ||
<library name="actuate" /> | ||
<library name="polygonal-ds" /> | ||
</haxelib> | ||
<!-- Class files to compile (other referenced classes will automatically be included) --> | ||
<compileTargets> | ||
<compile path="src\RaiderWings.hx" /> | ||
</compileTargets> | ||
<!-- Assets to embed into the output SWF --> | ||
<library> | ||
<!-- example: <asset path="..." id="..." update="..." glyphs="..." mode="..." place="..." sharepoint="..." /> --> | ||
</library> | ||
<!-- Paths to exclude from the Project Explorer tree --> | ||
<hiddenPaths> | ||
<hidden path="obj" /> | ||
</hiddenPaths> | ||
<!-- Executed before build --> | ||
<preBuildCommand /> | ||
<!-- Executed after build --> | ||
<postBuildCommand alwaysRun="False" /> | ||
<!-- Other project options --> | ||
<options> | ||
<option showHiddenPaths="False" /> | ||
<option testMovie="Custom" /> | ||
<option testMovieCommand="" /> | ||
</options> | ||
<!-- Plugin storage --> | ||
<storage /> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<project> | ||
<!-- NMML reference: https://gist.github.com/1763850 --> | ||
|
||
<!-- metadata, make sure 'package' is at least 3 segments (ie. com.mycompany.myproject) --> | ||
<meta title="Raider Wings" package="com.sphaeraobscura.raiderwings" version="1.0.0" company="Dmitriy Barabanschikov" /> | ||
|
||
<!-- output --> | ||
<app main="RaiderWings" file="RaiderWings" path="bin" /> | ||
|
||
|
||
|
||
|
||
<window background="#000000" fps="60" /> | ||
<window width="800" height="480" unless="mobile" /> | ||
<window orientation="landscape" vsync="false" antialiasing="0" if="cpp" /> | ||
|
||
<!-- classpath, haxe libs --> | ||
<source path="src" /> | ||
<haxelib name="openfl" /> | ||
<haxelib name="actuate" /> | ||
<haxelib name="polygonal-ds" /> | ||
|
||
<!-- assets --> | ||
<icon path="assets/openfl.svg" /> | ||
<assets path="assets" include="*" exclude="*.psd" /> | ||
|
||
<!-- optimize output | ||
<haxeflag name="-dce full" /> --> | ||
|
||
</project> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Diff not rendered.
Oops, something went wrong.
Diff not rendered.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
About OpenFL | ||
|
||
OpenFL is the successor of NME, for Haxe 3+. | ||
|
||
Building a game or application with OpenFL is almost like writing for a single platform. However, | ||
when you are ready to publish your application, you can choose between targets like iOS, webOS, | ||
Android, Windows, Mac, Linux and Flash Player. | ||
|
||
Instead of using the lowest common denominator between platforms with a "universal" runtime, | ||
OpenFL projects are compiled as SWF bytecode or C++ applications, using the Haxe language compiler | ||
and the standard C++ compiler toolchain for each platform. | ||
|
||
Read more: | ||
http://openfl.org/ | ||
|
||
Project configuration, libraries, classpaths | ||
|
||
OpenFL configuration is based on a XML file - it allows you very complex | ||
configurations depending on the target platform. There is no GUI for it. | ||
|
||
DO NOT modify FlashDevelop project properties as they will automatically be synchronized with the | ||
XML when you modify it. | ||
|
||
Development | ||
|
||
OpenFL is encouraging to develop using the Flash API (ie. flash.display.Sprite) as in ActionScript 3. | ||
|
||
Just code like you would code a Flash application, with the limitation that you can only use | ||
the drawing API, bitmaps (see below) and TextFields. | ||
|
||
However test often all the platforms you plan to target! | ||
|
||
In OpenFL 3.x, SWFs and videos aren't supported yet. | ||
|
||
Assets | ||
|
||
Place all your images, sounds, fonts in /assets and access them in your code using the | ||
global Assets class which abstracts assets management for all platforms: | ||
|
||
var img = new Bitmap(Assets.getBitmapData("assets/my-image.png")); | ||
addChild(img); | ||
|
||
Tutorials: | ||
https://github.com/openfl/openfl/wiki/Get-Started | ||
|
||
Debugging | ||
|
||
By default your project targets Flash so you'll be able to add breakpoints and debug your app | ||
like any AS3 project. | ||
HTML5 target can be debugged in the browser - some browsers, like Chrome, support "script maps" | ||
which let you interactively debug .hx code directly instead of the generated JS. | ||
There is however no interactive debugger yet for native targets. | ||
|
||
Changing target platform | ||
|
||
For OpenFL projects, an additional drop-down menu appears in the main toolbar where you can choose | ||
a supported targets on Windows: flash, html5, windows, neko, android, webos, blackberry. | ||
You can also manually enter a custom target not in the list. | ||
|
||
Attention, for native targets you'll need to install additional compilers & SDKs. The compiler | ||
will tell you in the Output panel what command to execute for that. More information here: | ||
https://github.com/openfl/openfl/wiki/Get-Started | ||
|
||
Tips: | ||
- in C++ expect first compilation to be very long as it first compiles the whole OpenFL API, | ||
- if a change is not taken in account, delete everything in /bin to start a fresh compilation, | ||
- on mobile, Bitmap blitting is NOT performant, | ||
- use spritesheets and Tilesheet.drawTiles for optimal rendering performance. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import flash.events.Event; | ||
import flash.Lib; | ||
import flash.text.TextField; | ||
import flash.text.TextFormat; | ||
|
||
class FPS extends TextField | ||
{ | ||
var times:Array<Float>; | ||
|
||
public function new(inX:Float=10.0, inY:Float=10.0, inCol:Int = 0x000000) | ||
{ | ||
super(); | ||
x = inX; | ||
y = inY; | ||
selectable = false; | ||
embedFonts = true; | ||
defaultTextFormat = new TextFormat(FontManager.mainFont.fontName, 16, 0, true); | ||
text = "FPS:"; | ||
textColor = inCol; | ||
times = []; | ||
addEventListener(Event.ENTER_FRAME, enterFrame); | ||
} | ||
|
||
private function enterFrame(e:Event):Void | ||
{ | ||
var now = Lib.getTimer () / 1000; | ||
times.push(now); | ||
while(times[0]<now-1) | ||
times.shift(); | ||
if (visible) | ||
{ | ||
text = "FPS:\n" + times.length + "/" + Lib.current.stage.frameRate; | ||
} | ||
} | ||
|
||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package ; | ||
import flash.text.Font; | ||
import openfl.Assets; | ||
/** | ||
* ... | ||
* @author Dmitriy Barabanschikov | ||
*/ | ||
|
||
class FontManager | ||
{ | ||
static public var mainFont:Font; | ||
|
||
static public function initialize():Void | ||
{ | ||
mainFont = Assets.getFont("assets/fonts/04B_03.TTF"); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
package ; | ||
|
||
import flash.display.Sprite; | ||
import flash.events.Event; | ||
import flash.Lib; | ||
|
||
/** | ||
* ... | ||
* @author Dmitriy Barabanschikov | ||
*/ | ||
|
||
class Main extends Sprite | ||
{ | ||
var inited:Bool; | ||
|
||
/* ENTRY POINT */ | ||
|
||
function resize(e) | ||
{ | ||
if (!inited) init(); | ||
// else (resize or orientation change) | ||
} | ||
|
||
function init() | ||
{ | ||
if (inited) return; | ||
inited = true; | ||
|
||
// (your code here) | ||
|
||
// Stage: | ||
// stage.stageWidth x stage.stageHeight @ stage.dpiScale | ||
|
||
// Assets: | ||
// nme.Assets.getBitmapData("img/assetname.jpg"); | ||
} | ||
|
||
/* SETUP */ | ||
|
||
public function new() | ||
{ | ||
super(); | ||
addEventListener(Event.ADDED_TO_STAGE, added); | ||
} | ||
|
||
function added(e) | ||
{ | ||
removeEventListener(Event.ADDED_TO_STAGE, added); | ||
stage.addEventListener(Event.RESIZE, resize); | ||
#if ios | ||
haxe.Timer.delay(init, 100); // iOS 6 | ||
#else | ||
init(); | ||
#end | ||
} | ||
|
||
public static function main() | ||
{ | ||
// static entry point | ||
Lib.current.stage.align = flash.display.StageAlign.TOP_LEFT; | ||
Lib.current.stage.scaleMode = flash.display.StageScaleMode.NO_SCALE; | ||
Lib.current.addChild(new Main()); | ||
} | ||
} |
Oops, something went wrong.