1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2024-12-27 15:37:49 +00:00

scrolling text framerate type beat

This commit is contained in:
Cameron Taylor 2021-12-06 00:13:11 -05:00
parent 06da64ac20
commit 87727942b1
3 changed files with 86 additions and 11 deletions

View file

@ -21,6 +21,7 @@ import flixel.util.FlxSpriteUtil;
import flixel.util.FlxTimer;
import freeplayStuff.BGScrollingText;
import freeplayStuff.DJBoyfriend;
import freeplayStuff.FreeplayScore;
import freeplayStuff.SongMenuItem;
import lime.app.Future;
import lime.utils.Assets;
@ -38,6 +39,7 @@ class FreeplayState extends MusicBeatSubstate
var curDifficulty:Int = 1;
var scoreText:FlxText;
var fp:FreeplayScore;
var diffText:FlxText;
var lerpScore:Float = 0;
var intendedScore:Int = 0;
@ -146,12 +148,12 @@ class FreeplayState extends MusicBeatSubstate
var moreWays:BGScrollingText = new BGScrollingText(0, 200, "HOT BLOODED IN MORE WAYS THAN ONE", FlxG.width);
moreWays.funnyColor = 0xFFfff383;
moreWays.speed = 2;
moreWays.speed = 4;
grpTxtScrolls.add(moreWays);
var funnyScroll:BGScrollingText = new BGScrollingText(0, 250, "BOYFRIEND", FlxG.width / 2);
funnyScroll.funnyColor = 0xFFff9963;
funnyScroll.speed = -0.5;
funnyScroll.speed = -1;
grpTxtScrolls.add(funnyScroll);
var txtNuts:BGScrollingText = new BGScrollingText(0, 300, "PROTECT YO NUTS", FlxG.width / 2);
@ -159,32 +161,33 @@ class FreeplayState extends MusicBeatSubstate
var funnyScroll2:BGScrollingText = new BGScrollingText(0, 340, "BOYFRIEND", FlxG.width / 2);
funnyScroll2.funnyColor = 0xFFff9963;
funnyScroll2.speed = -0.6;
funnyScroll2.speed = -1.2;
grpTxtScrolls.add(funnyScroll2);
var moreWays2:BGScrollingText = new BGScrollingText(0, 400, "HOT BLOODED IN MORE WAYS THAN ONE", FlxG.width);
moreWays2.funnyColor = 0xFFfff383;
moreWays2.speed = 2.2;
moreWays2.speed = 4.4;
grpTxtScrolls.add(moreWays2);
var funnyScroll3:BGScrollingText = new BGScrollingText(0, orangeBackShit.y, "BOYFRIEND", FlxG.width / 2);
funnyScroll3.funnyColor = 0xFFff9963;
funnyScroll3.speed = -0.4;
funnyScroll3.speed = -0.8;
grpTxtScrolls.add(funnyScroll3);
var dj:DJBoyfriend = new DJBoyfriend(0, -100);
add(dj);
var bgDad:FlxSprite = new FlxSprite(FlxG.width, 0).loadGraphic(Paths.image('freeplay/freeplayBGdad'));
var bgDad:FlxSprite = new FlxSprite(pinkBack.width * 0.75, 0).loadGraphic(Paths.image('freeplay/freeplayBGdad'));
bgDad.setGraphicSize(0, FlxG.height);
bgDad.updateHitbox();
bgDad.shader = new AngleMask();
bgDad.visible = false;
var blackOverlayBullshitLOLXD:FlxSprite = new FlxSprite(pinkBack.width * 0.75).makeGraphic(Std.int(bgDad.width), Std.int(bgDad.height),
FlxColor.BLACK);
// add(blackOverlayBullshitLOLXD); // used to mask the text lol!
var blackOverlayBullshitLOLXD:FlxSprite = new FlxSprite(FlxG.width).makeGraphic(Std.int(bgDad.width), Std.int(bgDad.height), FlxColor.BLACK);
add(blackOverlayBullshitLOLXD); // used to mask the text lol!
add(bgDad);
FlxTween.tween(blackOverlayBullshitLOLXD, {x: pinkBack.width * 0.75}, 1, {ease: FlxEase.quintOut});
blackOverlayBullshitLOLXD.shader = bgDad.shader;
@ -206,6 +209,10 @@ class FreeplayState extends MusicBeatSubstate
fnfFreeplay.shader = sillyStroke;
add(fnfFreeplay);
fp = new FreeplayScore(420, 40, 100);
fp.visible = false;
add(fp);
dj.animHITsignal.add(function()
{
var animShit:ComboCounter = new ComboCounter(100, 300, 1000000);
@ -214,6 +221,8 @@ class FreeplayState extends MusicBeatSubstate
new FlxTimer().start(1 / 24, function(handShit)
{
fnfFreeplay.visible = true;
fp.visible = true;
fp.updateScore(0);
new FlxTimer().start(1.5 / 24, function(bold)
{
@ -224,7 +233,7 @@ class FreeplayState extends MusicBeatSubstate
pinkBack.color = 0xFFffd863;
// fnfFreeplay.visible = true;
FlxTween.tween(bgDad, {x: pinkBack.width * 0.75}, 1, {ease: FlxEase.quintOut});
bgDad.visible = true;
orangeBackShit.visible = true;
alsoOrangeLOL.visible = true;
grpTxtScrolls.visible = true;
@ -238,6 +247,8 @@ class FreeplayState extends MusicBeatSubstate
funnyMenu.alpha = 0.5;
funnyMenu.songText.visible = false;
fp.updateScore(0);
new FlxTimer().start((1 / 24) * i, function(doShit)
{
funnyMenu.doJumpIn = true;
@ -578,6 +589,8 @@ class FreeplayState extends MusicBeatSubstate
function changeSelection(change:Int = 0)
{
fp.updateScore(0);
NGio.logEvent('Fresh');
// NGio.logEvent('Fresh');

View file

@ -60,7 +60,7 @@ class BGScrollingText extends FlxSpriteGroup
{
for (txt in grpTexts.group)
{
txt.x -= 1 * speed;
txt.x -= 1 * (speed * (FlxG.elapsed / (1 / 60)));
if (speed > 0)
{

View file

@ -0,0 +1,62 @@
package freeplayStuff;
import flixel.FlxSprite;
import flixel.group.FlxSpriteGroup.FlxTypedSpriteGroup;
class FreeplayScore extends FlxTypedSpriteGroup<ScoreNum>
{
public var scoreShit:Int = 0;
public function new(x:Float, y:Float, scoreShit:Int = 100)
{
super(x, y);
this.scoreShit = scoreShit;
for (i in 0...7)
{
add(new ScoreNum(x + (45 * i), y, 0));
}
}
public function updateScore(scoreNew:Int)
{
forEach(function(numScore)
{
numScore.digit = 8;
});
}
}
class ScoreNum extends FlxSprite
{
public var digit(default, set):Int = 0;
function set_digit(val):Int
{
animation.play(Std.string(FlxG.random.int(0, 9)), true, false, 0);
return val;
}
public function new(x:Float, y:Float, ?initDigit:Int = 0)
{
super(x, y);
frames = Paths.getSparrowAtlas('noteComboNumbers');
for (i in 0...10)
{
var stringNum:String = Std.string(i);
animation.addByPrefix(stringNum, stringNum, 24, false);
}
this.digit = initDigit;
animation.play(Std.string(digit), true);
antialiasing = true;
setGraphicSize(Std.int(width * 0.3));
updateHitbox();
}
}