Skip to content

Commit

Permalink
Initial commit for github
Browse files Browse the repository at this point in the history
  • Loading branch information
Dimonte committed Mar 23, 2014
0 parents commit 7831f17
Show file tree
Hide file tree
Showing 108 changed files with 5,593 additions and 0 deletions.
1 change: 1 addition & 0 deletions .build
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
6
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
bin
unoptimized assets
/*.keystore
61 changes: 61 additions & 0 deletions Raider Wings.hxproj
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&#xA;lime_native&#xA;no-compilation&#xA;display&#xA;windows&#xA;desktop" />
<option flashStrict="False" />
<option noInlineOnDebug="False" />
<option mainClass="ApplicationMain" />
<option enabledebug="True" />
<option additional="--no-output&#xA;--macro allowPackage('flash')&#xA;--macro keep(&quot;RaiderWings&quot;)" />
</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>
31 changes: 31 additions & 0 deletions application.xml
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>
Binary file added assets/effects/bulletHit/bulletHit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/effects/debries/debries1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/effects/debries/debries2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/effects/debries/debries3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/effects/explosion1/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/effects/explosion1/2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/effects/explosion1/3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/effects/explosion1/4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/effects/explosion1/5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/effects/projectiles/beam01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/effects/projectiles/beam02.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/effects/projectiles/enemyBalloonBullet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/effects/projectiles/railgunTrail.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/effects/smoke/smoke01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/effects/smoke/smoke02.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/effects/smoke/smoke03.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/effects/smoke/smoke04.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/effects/smoke/smoke05.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/fonts/04B_03.TTF
Binary file not shown.
1 change: 1 addition & 0 deletions assets/fonts/04B_03.TTF.hash

Large diffs are not rendered by default.

Binary file added assets/general/goButton.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/general/sky.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/objects/enemies/foe02.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/objects/enemies/tesla1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/objects/enemies/tesla2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/objects/enemies/tesla3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/objects/player/plane01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions assets/openfl.svg
Binary file added assets/rw.png
26 changes: 26 additions & 0 deletions assets/rw.svg
Binary file added assets/rw2.png
28 changes: 28 additions & 0 deletions assets/rw2.svg
Binary file added assets/tiles/middle.png
Binary file added assets/tiles/middle2.png
Binary file added assets/tiles/slopeDown.png
Binary file added assets/tiles/slopeUp.png
Binary file added assets/tiles/top.png
Binary file added assets/tiles/top2.png
Binary file added assets/tiles/tst1.png
Binary file added assets/tiles/tst4.png
Binary file added assets/tiles/tstM.png
Binary file added assets/ui/gameOverText.png
Binary file added assets/ui/gameOverText.psd
Diff not rendered.
Binary file added assets/ui/joystickHead.png
Binary file added assets/ui/joystickHead.psd
Diff not rendered.
68 changes: 68 additions & 0 deletions openfl-readme.txt
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.
38 changes: 38 additions & 0 deletions src/FPS.hx
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;
}
}



}
18 changes: 18 additions & 0 deletions src/FontManager.hx
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");
}

}
64 changes: 64 additions & 0 deletions src/Main.hx
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());
}
}
Loading

0 comments on commit 7831f17

Please sign in to comment.