mirror of
https://github.com/ninjamuffin99/Funkin.git
synced 2024-09-12 05:07:06 +00:00
Merge branch 'swf'
This commit is contained in:
commit
592204bfa7
|
@ -128,6 +128,11 @@
|
|||
<haxelib name="newgrounds"/>
|
||||
<haxelib name="hxcpp-debug-server" if="desktop debug"/>
|
||||
|
||||
<!-- swf stufffff -->
|
||||
<haxelib name="swf"/>
|
||||
<library path="assets/tanky.swf" preload="true"/>
|
||||
<library path="assets/tankBG.swf" preload="true"/>
|
||||
|
||||
<!-- <haxelib name="flixel-animate" /> -->
|
||||
<!-- <haxelib name="spinehaxe" /> -->
|
||||
<!-- https://github.com/ninjamuffin99/Flixel-Animate-Atlas-Player -->
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package;
|
||||
|
||||
import animate.FlxAnimate;
|
||||
import flixel.FlxG;
|
||||
import flixel.FlxSprite;
|
||||
import flixel.FlxState;
|
||||
|
@ -9,10 +8,13 @@ import flixel.group.FlxGroup.FlxTypedGroup;
|
|||
import flixel.math.FlxPoint;
|
||||
import flixel.text.FlxText;
|
||||
import flixel.util.FlxColor;
|
||||
import openfl.Assets;
|
||||
import openfl.display.BitmapData;
|
||||
import openfl.display.MovieClip;
|
||||
import openfl.display.Timeline;
|
||||
import openfl.geom.Matrix;
|
||||
import openfl.geom.Rectangle;
|
||||
|
||||
// import animateAtlasPlayer.assets.AssetManager;
|
||||
// import animateAtlasPlayer.core.Animation;
|
||||
class CutsceneAnimTestState extends FlxState
|
||||
{
|
||||
var cutsceneGroup:CutsceneCharacter;
|
||||
|
@ -20,6 +22,9 @@ class CutsceneAnimTestState extends FlxState
|
|||
var curSelected:Int = 0;
|
||||
var debugTxt:FlxText;
|
||||
|
||||
var funnySprite:FlxSprite = new FlxSprite();
|
||||
var clip:MovieClip;
|
||||
|
||||
public function new()
|
||||
{
|
||||
super();
|
||||
|
@ -32,50 +37,45 @@ class CutsceneAnimTestState extends FlxState
|
|||
debugTxt.color = FlxColor.BLUE;
|
||||
add(debugTxt);
|
||||
|
||||
var animated:FlxAnimate = new FlxAnimate(600, 200);
|
||||
add(animated);
|
||||
clip = Assets.getMovieClip("tanky:");
|
||||
// clip.x = FlxG.width/2;
|
||||
// clip.y = FlxG.height/2;
|
||||
FlxG.stage.addChild(clip);
|
||||
|
||||
// createCutscene(0);
|
||||
// createCutscene(1);
|
||||
// createCutscene(2);
|
||||
// createCutscene(3);
|
||||
// createCutscene(4);
|
||||
var swagShit:MovieClip = Assets.getMovieClip('tankBG:');
|
||||
// swagShit.scaleX = 5;
|
||||
|
||||
FlxG.stage.addChild(swagShit);
|
||||
swagShit.gotoAndStop(13);
|
||||
|
||||
var swfMountain = new BitmapData(FlxG.width, FlxG.height, true, 0x00000000);
|
||||
swfMountain.draw(swagShit, swagShit.transform.matrix);
|
||||
|
||||
var mountains:FlxSprite = new FlxSprite().loadGraphic(swfMountain);
|
||||
// add(mountains);
|
||||
|
||||
FlxG.stage.removeChild(swagShit);
|
||||
|
||||
funnySprite.x = FlxG.width / 2;
|
||||
funnySprite.y = FlxG.height / 2;
|
||||
add(funnySprite);
|
||||
}
|
||||
|
||||
override function update(elapsed:Float)
|
||||
{
|
||||
/* if (FlxG.keys.pressed.SHIFT)
|
||||
{
|
||||
if (FlxG.keys.justPressed.UP)
|
||||
curSelected -= 1;
|
||||
if (FlxG.keys.justPressed.DOWN)
|
||||
curSelected += 1;
|
||||
|
||||
if (curSelected < 0)
|
||||
curSelected = cutsceneGroup.members.length - 1;
|
||||
if (curSelected >= cutsceneGroup.members.length)
|
||||
curSelected = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
var valueMulti:Float = 1;
|
||||
|
||||
if (FlxG.keys.pressed.SPACE)
|
||||
valueMulti = 10;
|
||||
|
||||
if (FlxG.keys.justPressed.UP)
|
||||
cutsceneGroup.members[curSelected].y -= valueMulti;
|
||||
if (FlxG.keys.justPressed.DOWN)
|
||||
cutsceneGroup.members[curSelected].y += valueMulti;
|
||||
if (FlxG.keys.justPressed.LEFT)
|
||||
cutsceneGroup.members[curSelected].x -= valueMulti;
|
||||
if (FlxG.keys.justPressed.RIGHT)
|
||||
cutsceneGroup.members[curSelected].x += valueMulti;
|
||||
}
|
||||
|
||||
debugTxt.text = curSelected + " : " + cutsceneGroup.members[curSelected].getPosition();
|
||||
*/
|
||||
|
||||
super.update(elapsed);
|
||||
|
||||
// jam sprite into top left corner
|
||||
var drawMatrix:Matrix = clip.transform.matrix;
|
||||
var bounds:Rectangle = clip.getBounds(null);
|
||||
drawMatrix.tx = -bounds.x;
|
||||
drawMatrix.ty = -bounds.y;
|
||||
// make bitmapdata only as big as it needs to be
|
||||
var funnyBmp:BitmapData = new BitmapData(Math.ceil(bounds.width), Math.ceil(bounds.height), true, 0x00000000);
|
||||
funnyBmp.draw(clip, drawMatrix, true);
|
||||
funnySprite.loadGraphic(funnyBmp);
|
||||
// jam sprite back into place lol
|
||||
funnySprite.offset.x = -bounds.x;
|
||||
funnySprite.offset.y = -bounds.y;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ package;
|
|||
|
||||
import flixel.FlxG;
|
||||
import flixel.FlxGame;
|
||||
import flixel.FlxObject;
|
||||
import flixel.FlxSprite;
|
||||
import flixel.addons.transition.FlxTransitionSprite.GraphicTransTileDiamond;
|
||||
import flixel.addons.transition.FlxTransitionableState;
|
||||
|
@ -48,6 +49,7 @@ import sys.thread.Thread;
|
|||
class TitleState extends MusicBeatState
|
||||
{
|
||||
public static var initialized:Bool = false;
|
||||
|
||||
var startedIntro:Bool;
|
||||
|
||||
var blackScreen:FlxSprite;
|
||||
|
@ -467,9 +469,55 @@ class TitleState extends MusicBeatState
|
|||
if (controls.UI_RIGHT)
|
||||
swagShader.update(elapsed * 0.1);
|
||||
|
||||
if (!cheatActive && skippedIntro)
|
||||
cheatCodeShit();
|
||||
|
||||
super.update(elapsed);
|
||||
}
|
||||
|
||||
var cheatArray:Array<Int> = [0x0001, 0x0010, 0x0001, 0x0010, 0x0100, 0x1000, 0x0100, 0x1000];
|
||||
var curCheatPos:Int = 0;
|
||||
var cheatActive:Bool = false;
|
||||
|
||||
function cheatCodeShit():Void
|
||||
{
|
||||
if (FlxG.keys.justPressed.ANY)
|
||||
{
|
||||
if (controls.NOTE_DOWN_P || controls.UI_DOWN_P)
|
||||
codePress(FlxObject.DOWN);
|
||||
if (controls.NOTE_UP_P || controls.UI_UP_P)
|
||||
codePress(FlxObject.UP);
|
||||
if (controls.NOTE_LEFT_P || controls.UI_LEFT_P)
|
||||
codePress(FlxObject.LEFT);
|
||||
if (controls.NOTE_RIGHT_P || controls.UI_RIGHT_P)
|
||||
codePress(FlxObject.RIGHT);
|
||||
}
|
||||
}
|
||||
|
||||
function codePress(input:Int)
|
||||
{
|
||||
if (input == cheatArray[curCheatPos])
|
||||
{
|
||||
curCheatPos += 1;
|
||||
if (curCheatPos >= cheatArray.length)
|
||||
startCheat();
|
||||
}
|
||||
else
|
||||
curCheatPos = 0;
|
||||
|
||||
trace(input);
|
||||
}
|
||||
|
||||
function startCheat():Void
|
||||
{
|
||||
cheatActive = true;
|
||||
|
||||
FlxG.sound.playMusic(Paths.music('tutorialTitle'), 1);
|
||||
Conductor.changeBPM(190);
|
||||
FlxG.camera.flash(FlxColor.WHITE, 1);
|
||||
FlxG.sound.play(Paths.sound('confirmMenu'), 0.7);
|
||||
}
|
||||
|
||||
function createCoolText(textArray:Array<String>)
|
||||
{
|
||||
for (i in 0...textArray.length)
|
||||
|
@ -506,8 +554,10 @@ class TitleState extends MusicBeatState
|
|||
{
|
||||
super.beatHit();
|
||||
|
||||
if (!startedIntro)
|
||||
return ;
|
||||
if (cheatActive && curBeat % 2 == 0)
|
||||
swagShader.update(0.125);
|
||||
|
||||
logoBl.animation.play('bump', true);
|
||||
|
||||
if (skippedIntro)
|
||||
{
|
||||
|
|
20
source/ui/StageBuilderState.hx
Normal file
20
source/ui/StageBuilderState.hx
Normal file
|
@ -0,0 +1,20 @@
|
|||
package ui;
|
||||
|
||||
import flixel.FlxSprite;
|
||||
import flixel.addons.display.FlxGridOverlay;
|
||||
|
||||
class StageBuilderState extends MusicBeatState
|
||||
{
|
||||
public function new()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override function create()
|
||||
{
|
||||
super.create();
|
||||
|
||||
var bg:FlxSprite = FlxGridOverlay.create(10, 10);
|
||||
add(bg);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue