Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
115 changes: 115 additions & 0 deletions Project.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<!------------------------------APPLICATION SETTINGS---------------------------->

<app title="tuxcoding" file="tuxcoding" main="Main" version="0.0.1" company="Zaphod" />
<!--The flixel preloader is not accurate in Chrome. You can use it regularly if you embed the swf into a html file
<!--or you can set the actual size of your file manually at "FlxPreloaderBase-onUpdate-bytesTotal"!-->
<app preloader="flixel.system.FlxPreloader" />

<!--Minimum without FLX_NO_GAMEPAD: 11.8, without FLX_NO_NATIVE_CURSOR: 11.2 -->
<set name="SWF_VERSION" value="11.8" />

<!--------------------------------WINDOW SETTINGS------------------------------->

<!--These window settings apply to all targets-->
<window width="1024" height="600" fps="30" background="#000000" hardware="true" vsync="true" />

<!--Web-specific-->
<window if="web" orientation="portrait" />

<!--Desktop-specific-->
<window if="desktop" orientation="landscape" fullscreen="false" resizable="true" />

<!--Mobile-specific-->
<window if="mobile" orientation="portrait" fullscreen="true" width="0" height="0" />

<!--------------------------------PATHS SETTINGS-------------------------------->

<set name="BUILD_DIR" value="export" />
<classpath name="source" />
<assets path="assets" />

<assets path="assets" if="android">
<sound path="data/beep.wav" id="Beep" />

<!-- Your sound embedding code here... -->

</assets>

<assets path="assets" if="desktop">
<sound path="data/beep.wav" id="Beep" />

<!-- Your sound embedding code here... -->

</assets>

<assets path="assets" if="flash">
<sound path="data/beep.mp3" id="Beep" />

<!-- Your sound embedding code here... -->

</assets>

<assets path="assets" if="target_js">
<sound path="data/beep.mp3" id="Beep" />

<!-- Your sound embedding code here... -->

</assets>

<assets path="assets" exclude="*.wav" if="flash" />
<assets path="assets" exclude="*.svg" if="html5" />
<assets path="assets" if="desktop" />
<assets path="assets" if="mobile" />

<icon name="assets/HaxeFlixel.svg" />
<!--------------------------------LIBRARIES------------------------------------->

<haxelib name="flixel" />

<!--In case you want to use the addons package-->
<haxelib name="flixel-addons" />

<!--In case you want to use the ui package-->
<!--haxelib name="flixel-ui"/-->

<!--In case you want to use nape with flixel-->
<!--haxelib name="nape" /-->

<!--------------------------------HAXEDEFINES----------------------------------->

<!--Enable the Flixel core recording system-->
<!--haxedef name="FLX_RECORD" /-->

<!--Disable the right and middle mouse buttons-->
<!--haxedef name="FLX_NO_MOUSE_ADVANCED" /-->

<!--Disable the Native cursor api for Flash target-->
<!--haxedef name="FLX_NO_NATIVE_CURSOR" /-->

<!--Optimise inputs, be careful you will get null errors if you don't use conditionals in your game-->
<!--haxedef name="FLX_NO_MOUSE" if="mobile" /-->
<!--haxedef name="FLX_NO_KEYBOARD" if="mobile" /-->
<!--haxedef name="FLX_NO_TOUCH" if="desktop" /-->
<!--haxedef name="FLX_NO_GAMEPAD" /-->

<!--Disable the Flixel core sound tray-->
<!--haxedef name="FLX_NO_SOUND_TRAY" /-->

<!--Disable the Flixel sound management code-->
<!--haxedef name="FLX_NO_SOUND_SYSTEM" /-->

<!--Disable the Flixel core focus lost screen-->
<!--haxedef name="FLX_NO_FOCUS_LOST_SCREEN" /-->

<!--Disable the Flixel core debugger. Automatically gets set whenever you compile in release mode!-->
<!--haxedef name="FLX_NO_DEBUG" unless="debug" /-->

<!--Enable this for Nape release builds for a serious peformance improvement-->
<haxedef name="NAPE_RELEASE_BUILD" unless="debug" />

<!--------------------------------CUSTOM---------------------------------------->

<!--Place custom nodes like icons here (higher priority to override the HaxeFlixel icon)-->
</project>
8 changes: 4 additions & 4 deletions source/CmdIcon.hx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

package ;

import org.flixel.FlxSprite;
import flixel.FlxSprite;

class CmdIcon extends FlxSprite
{
Expand All @@ -17,18 +17,18 @@ class CmdIcon extends FlxSprite
public var type(default, set_type) : Int;

private function set_type(t:Int):Int {
frame = t + 1;
animation.frameIndex = t + 1;
return type = t;
}

public function new(X:Float = 0, Y:Float = 0)
{
super(X, Y);
loadGraphic(AssetNames.Cmds, true, false);
loadGraphic(AssetNames.Cmds, true);
type = -1;
scale.x = Size / width;
scale.y = Size / height;
origin.make();
//origin.make();
antialiasing = true;
}
}
12 changes: 6 additions & 6 deletions source/CongratState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@

package ;

import org.flixel.FlxState;
import org.flixel.FlxButton;
import org.flixel.FlxG;
import org.flixel.FlxSprite;
import org.flixel.FlxText;
import flixel.FlxState;
import flixel.ui.FlxButton;
import flixel.FlxG;
import flixel.FlxSprite;
import flixel.text.FlxText;

class CongratState extends FlxState
{
Expand All @@ -25,7 +25,7 @@ class CongratState extends FlxState
add(msgWin);

var quitBtn:FlxButton = new FlxButton(0, 0, "", quit);
quitBtn.loadGraphic(AssetNames.ReturnLevelsBtn, true, false, 93, 105);
quitBtn.loadGraphic(AssetNames.ReturnLevelsBtn, true, 93, 105);
quitBtn.x = msgWin.x + (msgWin.width - quitBtn.width) / 2;
quitBtn.y = msgWin.y + msgWin.height - quitBtn.height - 50;
add(quitBtn);
Expand Down
18 changes: 10 additions & 8 deletions source/LevelBtn.hx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
*/

package ;
import org.flixel.FlxButton;
import org.flixel.FlxSprite;
import flixel.ui.FlxButton;
import flixel.FlxSprite;

/**
* Level Select Button, displays the level's number
Expand Down Expand Up @@ -36,13 +36,13 @@ class LevelBtn extends FlxButton
if (locked)
{
active = false;
frame = 3;
animation.frameIndex = 3;
label.text = "";
}
else
{
active = true;
frame = 0;
animation.frameIndex = 0;
}

return locked;
Expand All @@ -51,7 +51,7 @@ class LevelBtn extends FlxButton
private function set_numStars(NumStars:Int):Int
{
numStars = NumStars;
stars.frame = numStars;
stars.animation.frameIndex = numStars;

return numStars;
}
Expand All @@ -62,11 +62,13 @@ class LevelBtn extends FlxButton
num = Num;
onClick = OnClick;

loadGraphic(AssetNames.LvlBtn, true, false, 92, 105);
loadGraphic(AssetNames.LvlBtn, true, 92, 105);
label.setFormat(AssetNames.LvlBtnFont, 35, 0xd2343f, "center");
labelOffset.y = 20;

//TODO:
//labelOffset.y = 20;

stars = new FlxSprite().loadGraphic(AssetNames.Stars, true, false, 92, 105);
stars = new FlxSprite().loadGraphic(AssetNames.Stars, true, 92, 105);
}

private function _onClick():Void {
Expand Down
10 changes: 5 additions & 5 deletions source/LevelEnd.hx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@

package ;

import org.flixel.FlxState;
import org.flixel.FlxButton;
import org.flixel.FlxG;
import org.flixel.FlxSprite;
import org.flixel.FlxText;
import flixel.FlxState;
import flixel.ui.FlxButton;
import flixel.FlxG;
import flixel.FlxSprite;
import flixel.text.FlxText;

class LevelEnd extends FlxState
{
Expand Down
54 changes: 23 additions & 31 deletions source/Main.hx
Original file line number Diff line number Diff line change
Expand Up @@ -8,65 +8,57 @@

package;

import flash.display.Sprite;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.display.Sprite;
import flash.events.Event;
import flash.events.KeyboardEvent;
import flash.Lib;
import flash.ui.Keyboard;
import org.flixel.FlxGame;
import flixel.FlxGame;
import flixel.FlxState;

class Main extends Sprite
{

public function new ()
public static function main():Void
{
Lib.current.addChild(new Main());

}

public function new()
{
super();

if (stage != null)
{
init();
}
else
{
addEventListener(Event.ADDED_TO_STAGE, init);
}
}

private function init(?e:Event = null):Void
private function init(?E:Event):Void
{
if (hasEventListener(Event.ADDED_TO_STAGE))
{
removeEventListener(Event.ADDED_TO_STAGE, init);
}

initialize();

var demo:FlxGame = new ProjectClass();
addChild(demo);

#if (cpp || neko)
Lib.current.stage.addEventListener(KeyboardEvent.KEY_UP, onKeyUP);
#end
setupGame();
}

#if (cpp || neko)
private function onKeyUP(e:KeyboardEvent):Void
{
if (e.keyCode == Keyboard.ESCAPE)
{
Lib.exit();
}
}
#end


private function initialize():Void
{
Lib.current.stage.align = StageAlign.TOP_LEFT;
Lib.current.stage.scaleMode = StageScaleMode.NO_SCALE;
}
// Entry point
public static function main() {

private function setupGame():Void
{

Lib.current.addChild(new Main());
addChild(new ProjectClass());
//addChild(new FlxGame(gameWidth, gameHeight, initialState, zoom, framerate, framerate, skipSplash, startFullscreen));
}

}
}
Loading