1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2025-03-28 04:50:01 +00:00

Merge branch 'swf'

This commit is contained in:
Cameron Taylor 2021-05-14 17:21:50 -04:00
commit 592204bfa7
4 changed files with 119 additions and 44 deletions

View file

@ -128,6 +128,11 @@
<haxelib name="newgrounds"/> <haxelib name="newgrounds"/>
<haxelib name="hxcpp-debug-server" if="desktop debug"/> <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="flixel-animate" /> -->
<!-- <haxelib name="spinehaxe" /> --> <!-- <haxelib name="spinehaxe" /> -->
<!-- https://github.com/ninjamuffin99/Flixel-Animate-Atlas-Player --> <!-- https://github.com/ninjamuffin99/Flixel-Animate-Atlas-Player -->

View file

@ -1,6 +1,5 @@
package; package;
import animate.FlxAnimate;
import flixel.FlxG; import flixel.FlxG;
import flixel.FlxSprite; import flixel.FlxSprite;
import flixel.FlxState; import flixel.FlxState;
@ -9,10 +8,13 @@ import flixel.group.FlxGroup.FlxTypedGroup;
import flixel.math.FlxPoint; import flixel.math.FlxPoint;
import flixel.text.FlxText; import flixel.text.FlxText;
import flixel.util.FlxColor; import flixel.util.FlxColor;
import openfl.Assets;
import openfl.display.BitmapData; 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 class CutsceneAnimTestState extends FlxState
{ {
var cutsceneGroup:CutsceneCharacter; var cutsceneGroup:CutsceneCharacter;
@ -20,6 +22,9 @@ class CutsceneAnimTestState extends FlxState
var curSelected:Int = 0; var curSelected:Int = 0;
var debugTxt:FlxText; var debugTxt:FlxText;
var funnySprite:FlxSprite = new FlxSprite();
var clip:MovieClip;
public function new() public function new()
{ {
super(); super();
@ -32,50 +37,45 @@ class CutsceneAnimTestState extends FlxState
debugTxt.color = FlxColor.BLUE; debugTxt.color = FlxColor.BLUE;
add(debugTxt); add(debugTxt);
var animated:FlxAnimate = new FlxAnimate(600, 200); clip = Assets.getMovieClip("tanky:");
add(animated); // clip.x = FlxG.width/2;
// clip.y = FlxG.height/2;
FlxG.stage.addChild(clip);
// createCutscene(0); var swagShit:MovieClip = Assets.getMovieClip('tankBG:');
// createCutscene(1); // swagShit.scaleX = 5;
// createCutscene(2);
// createCutscene(3); FlxG.stage.addChild(swagShit);
// createCutscene(4); 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) 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); 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;
} }
} }

View file

@ -2,6 +2,7 @@ package;
import flixel.FlxG; import flixel.FlxG;
import flixel.FlxGame; import flixel.FlxGame;
import flixel.FlxObject;
import flixel.FlxSprite; import flixel.FlxSprite;
import flixel.addons.transition.FlxTransitionSprite.GraphicTransTileDiamond; import flixel.addons.transition.FlxTransitionSprite.GraphicTransTileDiamond;
import flixel.addons.transition.FlxTransitionableState; import flixel.addons.transition.FlxTransitionableState;
@ -48,6 +49,7 @@ import sys.thread.Thread;
class TitleState extends MusicBeatState class TitleState extends MusicBeatState
{ {
public static var initialized:Bool = false; public static var initialized:Bool = false;
var startedIntro:Bool; var startedIntro:Bool;
var blackScreen:FlxSprite; var blackScreen:FlxSprite;
@ -467,9 +469,55 @@ class TitleState extends MusicBeatState
if (controls.UI_RIGHT) if (controls.UI_RIGHT)
swagShader.update(elapsed * 0.1); swagShader.update(elapsed * 0.1);
if (!cheatActive && skippedIntro)
cheatCodeShit();
super.update(elapsed); 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>) function createCoolText(textArray:Array<String>)
{ {
for (i in 0...textArray.length) for (i in 0...textArray.length)
@ -506,8 +554,10 @@ class TitleState extends MusicBeatState
{ {
super.beatHit(); super.beatHit();
if (!startedIntro) if (cheatActive && curBeat % 2 == 0)
return ; swagShader.update(0.125);
logoBl.animation.play('bump', true);
if (skippedIntro) if (skippedIntro)
{ {

View 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);
}
}