diff --git a/Preloader.hx b/Preloader.hx new file mode 100644 index 0000000..37b63aa --- /dev/null +++ b/Preloader.hx @@ -0,0 +1,70 @@ +package ; + +import flixel.system.FlxBasePreloader; +import openfl.display.Sprite; +import flash.text.Font; +import flash.text.TextField; +import flash.text.TextFormat; +import flash.display.Bitmap; +import flash.display.BitmapData; +import flash.display.BlendMode; +import flash.display.Sprite; +import flash.Lib; +import flixel.FlxG; + +@:bitmap("assets/images/preloaderArt.png") class LogoImage extends BitmapData { } + +class Preloader extends FlxBasePreloader +{ + #if !js + public function new(MinDisplayTime:Float=5, ?AllowedURLs:Array) + { + super(MinDisplayTime, AllowedURLs); + } + + var logo:Sprite; + + override function create():Void + { + this._width = Lib.current.stage.stageWidth; + this._height = Lib.current.stage.stageHeight; + + var ratio:Float = this._width / 800; //This allows us to scale assets depending on the size of the screen. + + logo = new Sprite(); + logo.addChild(new Bitmap(new LogoImage(0,0))); //Sets the graphic of the sprite to a Bitmap object, which uses our embedded BitmapData class. + logo.scaleX = logo.scaleY = ratio; + logo.x = ((this._width) / 2) - ((logo.width) / 2); + logo.y = (this._height / 2) - ((logo.height) / 2); + addChild(logo); //Adds the graphic to the NMEPreloader's buffer. + + super.create(); + } + + override function update(Percent:Float):Void + { + if (Percent < 0.1) + { + logo.alpha = 0; + } + else if (Percent < 0.25) + { + logo.alpha = 0; + } + else if (Percent < 0.5) + { + logo.alpha = 1; + } + else if ((Percent > 0.75) && (Percent < 0.9)) + { + logo.alpha = 0; + } + else if (Percent > 0.9) + { + logo.alpha = 1; + } + + super.update(Percent); + } + #end +} \ No newline at end of file diff --git a/Project.xml b/Project.xml index d7c38fa..a947bbb 100644 --- a/Project.xml +++ b/Project.xml @@ -2,11 +2,12 @@ - + - + + diff --git a/art/FMOD Logo Black - White Background.png b/art/FMOD Logo Black - White Background.png new file mode 100644 index 0000000..24c0d51 Binary files /dev/null and b/art/FMOD Logo Black - White Background.png differ diff --git a/art/FMOD Logo White - Black Background.png b/art/FMOD Logo White - Black Background.png new file mode 100644 index 0000000..0675b5d Binary files /dev/null and b/art/FMOD Logo White - Black Background.png differ diff --git a/assets/images/preloaderArt.png b/assets/images/preloaderArt.png new file mode 100644 index 0000000..fc6e92c Binary files /dev/null and b/assets/images/preloaderArt.png differ diff --git a/source/Controls.hx b/source/Controls.hx index b251ac6..dc11a61 100644 --- a/source/Controls.hx +++ b/source/Controls.hx @@ -30,6 +30,7 @@ enum abstract Action(String) to String from String var BACK = "back"; var PAUSE = "pause"; var RESET = "reset"; + var CHEAT = "cheat"; } #else @:enum @@ -51,6 +52,7 @@ abstract Action(String) to String from String var BACK = "back"; var PAUSE = "pause"; var RESET = "reset"; + var CHEAT = "cheat"; } #end @@ -75,6 +77,7 @@ enum Control ACCEPT; BACK; PAUSE; + CHEAT; } enum KeyboardScheme @@ -107,6 +110,7 @@ class Controls extends FlxActionSet var _back = new FlxActionDigital(Action.BACK); var _pause = new FlxActionDigital(Action.PAUSE); var _reset = new FlxActionDigital(Action.RESET); + var _cheat = new FlxActionDigital(Action.CHEAT); #if (haxe >= "4.0.0") var byName:Map = []; @@ -197,6 +201,11 @@ class Controls extends FlxActionSet inline function get_RESET() return _reset.check(); + public var CHEAT(get, never):Bool; + + inline function get_CHEAT() + return _cheat.check(); + #if (haxe >= "4.0.0") public function new(name, scheme = None) { @@ -218,6 +227,7 @@ class Controls extends FlxActionSet add(_back); add(_pause); add(_reset); + add(_cheat); for (action in digitalActions) byName[action.name] = action; @@ -245,6 +255,7 @@ class Controls extends FlxActionSet add(_back); add(_pause); add(_reset); + add(_cheat); for (action in digitalActions) byName[action.name] = action; @@ -298,6 +309,7 @@ class Controls extends FlxActionSet case BACK: _back; case PAUSE: _pause; case RESET: _reset; + case CHEAT: _cheat; } } @@ -341,6 +353,8 @@ class Controls extends FlxActionSet func(_pause, JUST_PRESSED); case RESET: func(_reset, JUST_PRESSED); + case CHEAT: + func(_cheat, JUST_PRESSED); } } @@ -628,7 +642,9 @@ class Controls extends FlxActionSet Control.LEFT => [DPAD_LEFT, LEFT_STICK_DIGITAL_LEFT], Control.RIGHT => [DPAD_RIGHT, LEFT_STICK_DIGITAL_RIGHT], Control.PAUSE => [START], - Control.RESET => [Y] + //Swap Y and X for switch + Control.RESET => [Y], + Control.CHEAT => [X] ]); #end } diff --git a/source/PlayState.hx b/source/PlayState.hx index 06b41a2..e65bfa3 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -583,9 +583,13 @@ class PlayState extends MusicBeatState { super.update(elapsed); - trace("FlxG.elapsed: " + FlxG.elapsed); + #if lime + trace("IT'S LIME"); + #end + + //trace("FlxG.elapsed: " + FlxG.elapsed); trace("FlxG.sound.music.time: " + FlxG.sound.music.time); - trace("FlxG.sound.music.playing: " + FlxG.sound.music.playing); + //trace("FlxG.sound.music.playing: " + FlxG.sound.music.playing); //trace("SONG POS: " + Conductor.songPosition); // FlxG.sound.music.pitch = 2; @@ -727,6 +731,18 @@ class PlayState extends MusicBeatState } // better streaming of shit + //RESET = Quick Game Over Screen + if (controls.RESET){ + health = 0; + trace("RESET = True"); + } + + //CHEAT = brandon's a pussy + if (controls.CHEAT){ + health += 1; + trace("User is cheating!"); + } + if (health <= 0) { boyfriend.stunned = true; @@ -1288,9 +1304,9 @@ class PlayState extends MusicBeatState if (vocals.time > Conductor.songPosition + Conductor.stepCrochet || vocals.time < Conductor.songPosition - Conductor.stepCrochet) { - vocals.pause(); + //vocals.pause(); vocals.time = Conductor.songPosition; - vocals.play(); + //vocals.play(); } } diff --git a/source/TitleState.hx b/source/TitleState.hx index b6be87a..699de8a 100644 --- a/source/TitleState.hx +++ b/source/TitleState.hx @@ -76,6 +76,10 @@ class TitleState extends MusicBeatState function startIntro() { + #if switch + initialized = true; + #end + if (!initialized) { var diamond:FlxGraphic = FlxGraphic.fromClass(GraphicTransTileDiamond);