added debugs and cheats and we usin fmod
This commit is contained in:
parent
8f5788109e
commit
86e526d553
70
Preloader.hx
Normal file
70
Preloader.hx
Normal file
@ -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<String>)
|
||||||
|
{
|
||||||
|
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
|
||||||
|
}
|
@ -2,11 +2,12 @@
|
|||||||
<project>
|
<project>
|
||||||
<!-- _________________________ Application Settings _________________________ -->
|
<!-- _________________________ Application Settings _________________________ -->
|
||||||
|
|
||||||
<app title="Friday Night Funkin" file="Funkin" packageName="com.ninjamuffin99.fridaynightfunkin" main="Main" version="0.0.1" company="ninjamuffin99" />
|
<app title="Friday Night Funkin" file="Funkin" packageName="com.ninjamuffin99.funkin" main="Main" version="0.0.1" company="ninjamuffin99" />
|
||||||
|
|
||||||
<!--The flixel preloader is not accurate in Chrome. You can use it regularly if you embed the swf into a html file
|
<!--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"-->
|
or you can set the actual size of your file manually at "FlxPreloaderBase-onUpdate-bytesTotal"-->
|
||||||
<app preloader="flixel.system.FlxPreloader" />
|
<app preloader="flixel.system.FlxPreloader" unless="switch" />
|
||||||
|
<app preloader="Preloader" resizable="true" if="switch" />
|
||||||
|
|
||||||
<!--Minimum without FLX_NO_GAMEPAD: 11.8, without FLX_NO_NATIVE_CURSOR: 11.2-->
|
<!--Minimum without FLX_NO_GAMEPAD: 11.8, without FLX_NO_NATIVE_CURSOR: 11.2-->
|
||||||
<set name="SWF_VERSION" value="11.8" />
|
<set name="SWF_VERSION" value="11.8" />
|
||||||
|
BIN
art/FMOD Logo Black - White Background.png
Normal file
BIN
art/FMOD Logo Black - White Background.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.5 KiB |
BIN
art/FMOD Logo White - Black Background.png
Normal file
BIN
art/FMOD Logo White - Black Background.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.6 KiB |
BIN
assets/images/preloaderArt.png
Normal file
BIN
assets/images/preloaderArt.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 200 KiB |
@ -30,6 +30,7 @@ enum abstract Action(String) to String from String
|
|||||||
var BACK = "back";
|
var BACK = "back";
|
||||||
var PAUSE = "pause";
|
var PAUSE = "pause";
|
||||||
var RESET = "reset";
|
var RESET = "reset";
|
||||||
|
var CHEAT = "cheat";
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
@:enum
|
@:enum
|
||||||
@ -51,6 +52,7 @@ abstract Action(String) to String from String
|
|||||||
var BACK = "back";
|
var BACK = "back";
|
||||||
var PAUSE = "pause";
|
var PAUSE = "pause";
|
||||||
var RESET = "reset";
|
var RESET = "reset";
|
||||||
|
var CHEAT = "cheat";
|
||||||
}
|
}
|
||||||
#end
|
#end
|
||||||
|
|
||||||
@ -75,6 +77,7 @@ enum Control
|
|||||||
ACCEPT;
|
ACCEPT;
|
||||||
BACK;
|
BACK;
|
||||||
PAUSE;
|
PAUSE;
|
||||||
|
CHEAT;
|
||||||
}
|
}
|
||||||
|
|
||||||
enum KeyboardScheme
|
enum KeyboardScheme
|
||||||
@ -107,6 +110,7 @@ class Controls extends FlxActionSet
|
|||||||
var _back = new FlxActionDigital(Action.BACK);
|
var _back = new FlxActionDigital(Action.BACK);
|
||||||
var _pause = new FlxActionDigital(Action.PAUSE);
|
var _pause = new FlxActionDigital(Action.PAUSE);
|
||||||
var _reset = new FlxActionDigital(Action.RESET);
|
var _reset = new FlxActionDigital(Action.RESET);
|
||||||
|
var _cheat = new FlxActionDigital(Action.CHEAT);
|
||||||
|
|
||||||
#if (haxe >= "4.0.0")
|
#if (haxe >= "4.0.0")
|
||||||
var byName:Map<String, FlxActionDigital> = [];
|
var byName:Map<String, FlxActionDigital> = [];
|
||||||
@ -197,6 +201,11 @@ class Controls extends FlxActionSet
|
|||||||
inline function get_RESET()
|
inline function get_RESET()
|
||||||
return _reset.check();
|
return _reset.check();
|
||||||
|
|
||||||
|
public var CHEAT(get, never):Bool;
|
||||||
|
|
||||||
|
inline function get_CHEAT()
|
||||||
|
return _cheat.check();
|
||||||
|
|
||||||
#if (haxe >= "4.0.0")
|
#if (haxe >= "4.0.0")
|
||||||
public function new(name, scheme = None)
|
public function new(name, scheme = None)
|
||||||
{
|
{
|
||||||
@ -218,6 +227,7 @@ class Controls extends FlxActionSet
|
|||||||
add(_back);
|
add(_back);
|
||||||
add(_pause);
|
add(_pause);
|
||||||
add(_reset);
|
add(_reset);
|
||||||
|
add(_cheat);
|
||||||
|
|
||||||
for (action in digitalActions)
|
for (action in digitalActions)
|
||||||
byName[action.name] = action;
|
byName[action.name] = action;
|
||||||
@ -245,6 +255,7 @@ class Controls extends FlxActionSet
|
|||||||
add(_back);
|
add(_back);
|
||||||
add(_pause);
|
add(_pause);
|
||||||
add(_reset);
|
add(_reset);
|
||||||
|
add(_cheat);
|
||||||
|
|
||||||
for (action in digitalActions)
|
for (action in digitalActions)
|
||||||
byName[action.name] = action;
|
byName[action.name] = action;
|
||||||
@ -298,6 +309,7 @@ class Controls extends FlxActionSet
|
|||||||
case BACK: _back;
|
case BACK: _back;
|
||||||
case PAUSE: _pause;
|
case PAUSE: _pause;
|
||||||
case RESET: _reset;
|
case RESET: _reset;
|
||||||
|
case CHEAT: _cheat;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -341,6 +353,8 @@ class Controls extends FlxActionSet
|
|||||||
func(_pause, JUST_PRESSED);
|
func(_pause, JUST_PRESSED);
|
||||||
case RESET:
|
case RESET:
|
||||||
func(_reset, JUST_PRESSED);
|
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.LEFT => [DPAD_LEFT, LEFT_STICK_DIGITAL_LEFT],
|
||||||
Control.RIGHT => [DPAD_RIGHT, LEFT_STICK_DIGITAL_RIGHT],
|
Control.RIGHT => [DPAD_RIGHT, LEFT_STICK_DIGITAL_RIGHT],
|
||||||
Control.PAUSE => [START],
|
Control.PAUSE => [START],
|
||||||
Control.RESET => [Y]
|
//Swap Y and X for switch
|
||||||
|
Control.RESET => [Y],
|
||||||
|
Control.CHEAT => [X]
|
||||||
]);
|
]);
|
||||||
#end
|
#end
|
||||||
}
|
}
|
||||||
|
@ -583,9 +583,13 @@ class PlayState extends MusicBeatState
|
|||||||
{
|
{
|
||||||
super.update(elapsed);
|
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.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);
|
//trace("SONG POS: " + Conductor.songPosition);
|
||||||
// FlxG.sound.music.pitch = 2;
|
// FlxG.sound.music.pitch = 2;
|
||||||
|
|
||||||
@ -727,6 +731,18 @@ class PlayState extends MusicBeatState
|
|||||||
}
|
}
|
||||||
// better streaming of shit
|
// 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)
|
if (health <= 0)
|
||||||
{
|
{
|
||||||
boyfriend.stunned = true;
|
boyfriend.stunned = true;
|
||||||
@ -1288,9 +1304,9 @@ class PlayState extends MusicBeatState
|
|||||||
if (vocals.time > Conductor.songPosition + Conductor.stepCrochet
|
if (vocals.time > Conductor.songPosition + Conductor.stepCrochet
|
||||||
|| vocals.time < Conductor.songPosition - Conductor.stepCrochet)
|
|| vocals.time < Conductor.songPosition - Conductor.stepCrochet)
|
||||||
{
|
{
|
||||||
vocals.pause();
|
//vocals.pause();
|
||||||
vocals.time = Conductor.songPosition;
|
vocals.time = Conductor.songPosition;
|
||||||
vocals.play();
|
//vocals.play();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,6 +76,10 @@ class TitleState extends MusicBeatState
|
|||||||
|
|
||||||
function startIntro()
|
function startIntro()
|
||||||
{
|
{
|
||||||
|
#if switch
|
||||||
|
initialized = true;
|
||||||
|
#end
|
||||||
|
|
||||||
if (!initialized)
|
if (!initialized)
|
||||||
{
|
{
|
||||||
var diamond:FlxGraphic = FlxGraphic.fromClass(GraphicTransTileDiamond);
|
var diamond:FlxGraphic = FlxGraphic.fromClass(GraphicTransTileDiamond);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user