added some stuff
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 700 KiB After Width: | Height: | Size: 680 KiB |
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TextureAtlas imagePath="NOTE_assets.png">
|
||||
<!-- Created with Adobe Animate version 20.0.0.17400 -->
|
||||
<!-- http://www.adobe.com/products/animate.html -->
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
2
|
||||
@@ -32,6 +32,8 @@ import openfl.media.Sound;
|
||||
import openfl.net.FileReference;
|
||||
import openfl.utils.ByteArray;
|
||||
|
||||
import funkin.game.Note;
|
||||
|
||||
using StringTools;
|
||||
|
||||
class ChartingState extends MusicBeatState
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
package;
|
||||
|
||||
import flixel.FlxSprite;
|
||||
import flixel.FlxSubState;
|
||||
|
||||
class ControlsSubState extends FlxSubState
|
||||
{
|
||||
public function new()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
@@ -1,260 +0,0 @@
|
||||
package;
|
||||
|
||||
import flixel.FlxG;
|
||||
import flixel.FlxSprite;
|
||||
import flixel.addons.text.FlxTypeText;
|
||||
import flixel.graphics.frames.FlxAtlasFrames;
|
||||
import flixel.group.FlxSpriteGroup;
|
||||
import flixel.input.FlxKeyManager;
|
||||
import flixel.text.FlxText;
|
||||
import flixel.util.FlxColor;
|
||||
import flixel.util.FlxTimer;
|
||||
|
||||
using StringTools;
|
||||
|
||||
class DialogueBox extends FlxSpriteGroup
|
||||
{
|
||||
var box:FlxSprite;
|
||||
|
||||
var curCharacter:String = '';
|
||||
|
||||
var dialogue:Alphabet;
|
||||
var dialogueList:Array<String> = [];
|
||||
|
||||
// SECOND DIALOGUE FOR THE PIXEL SHIT INSTEAD???
|
||||
var swagDialogue:FlxTypeText;
|
||||
|
||||
var dropText:FlxText;
|
||||
|
||||
public var finishThing:Void->Void;
|
||||
|
||||
var portraitLeft:FlxSprite;
|
||||
var portraitRight:FlxSprite;
|
||||
|
||||
var handSelect:FlxSprite;
|
||||
var bgFade:FlxSprite;
|
||||
|
||||
public function new(talkingRight:Bool = true, ?dialogueList:Array<String>)
|
||||
{
|
||||
super();
|
||||
|
||||
switch (PlayState.SONG.song.toLowerCase())
|
||||
{
|
||||
case 'senpai':
|
||||
FlxG.sound.playMusic(Paths.music('Lunchbox'), 0);
|
||||
FlxG.sound.music.fadeIn(1, 0, 0.8);
|
||||
case 'thorns':
|
||||
FlxG.sound.playMusic(Paths.music('LunchboxScary'), 0);
|
||||
FlxG.sound.music.fadeIn(1, 0, 0.8);
|
||||
}
|
||||
|
||||
bgFade = new FlxSprite(-200, -200).makeGraphic(Std.int(FlxG.width * 1.3), Std.int(FlxG.height * 1.3), 0xFFB3DFd8);
|
||||
bgFade.scrollFactor.set();
|
||||
bgFade.alpha = 0;
|
||||
add(bgFade);
|
||||
|
||||
new FlxTimer().start(0.83, function(tmr:FlxTimer)
|
||||
{
|
||||
bgFade.alpha += (1 / 5) * 0.7;
|
||||
if (bgFade.alpha > 0.7)
|
||||
bgFade.alpha = 0.7;
|
||||
}, 5);
|
||||
|
||||
box = new FlxSprite(-20, 45);
|
||||
|
||||
var hasDialog = false;
|
||||
switch (PlayState.SONG.song.toLowerCase())
|
||||
{
|
||||
case 'senpai':
|
||||
hasDialog = true;
|
||||
box.frames = Paths.getSparrowAtlas('weeb/pixelUI/dialogueBox-pixel');
|
||||
box.animation.addByPrefix('normalOpen', 'Text Box Appear', 24, false);
|
||||
box.animation.addByIndices('normal', 'Text Box Appear', [4], "", 24);
|
||||
case 'roses':
|
||||
hasDialog = true;
|
||||
FlxG.sound.play(Paths.sound('ANGRY_TEXT_BOX'));
|
||||
|
||||
box.frames = Paths.getSparrowAtlas('weeb/pixelUI/dialogueBox-senpaiMad');
|
||||
box.animation.addByPrefix('normalOpen', 'SENPAI ANGRY IMPACT SPEECH', 24, false);
|
||||
box.animation.addByIndices('normal', 'SENPAI ANGRY IMPACT SPEECH', [4], "", 24);
|
||||
|
||||
case 'thorns':
|
||||
hasDialog = true;
|
||||
box.frames = Paths.getSparrowAtlas('weeb/pixelUI/dialogueBox-evil');
|
||||
box.animation.addByPrefix('normalOpen', 'Spirit Textbox spawn', 24, false);
|
||||
box.animation.addByIndices('normal', 'Spirit Textbox spawn', [11], "", 24);
|
||||
|
||||
var face:FlxSprite = new FlxSprite(320, 170).loadGraphic(Paths.image('weeb/spiritFaceForward'));
|
||||
face.setGraphicSize(Std.int(face.width * 6));
|
||||
add(face);
|
||||
}
|
||||
|
||||
this.dialogueList = dialogueList;
|
||||
|
||||
if (!hasDialog)
|
||||
return;
|
||||
|
||||
portraitLeft = new FlxSprite(-20, 40);
|
||||
portraitLeft.frames = Paths.getSparrowAtlas('weeb/senpaiPortrait');
|
||||
portraitLeft.animation.addByPrefix('enter', 'Senpai Portrait Enter', 24, false);
|
||||
portraitLeft.setGraphicSize(Std.int(portraitLeft.width * PlayState.daPixelZoom * 0.9));
|
||||
portraitLeft.updateHitbox();
|
||||
portraitLeft.scrollFactor.set();
|
||||
add(portraitLeft);
|
||||
portraitLeft.visible = false;
|
||||
|
||||
portraitRight = new FlxSprite(0, 40);
|
||||
portraitRight.frames = Paths.getSparrowAtlas('weeb/bfPortrait');
|
||||
portraitRight.animation.addByPrefix('enter', 'Boyfriend portrait enter', 24, false);
|
||||
portraitRight.setGraphicSize(Std.int(portraitRight.width * PlayState.daPixelZoom * 0.9));
|
||||
portraitRight.updateHitbox();
|
||||
portraitRight.scrollFactor.set();
|
||||
add(portraitRight);
|
||||
portraitRight.visible = false;
|
||||
|
||||
box.animation.play('normalOpen');
|
||||
box.setGraphicSize(Std.int(box.width * PlayState.daPixelZoom * 0.9));
|
||||
box.updateHitbox();
|
||||
add(box);
|
||||
|
||||
box.screenCenter(X);
|
||||
portraitLeft.screenCenter(X);
|
||||
|
||||
handSelect = new FlxSprite(FlxG.width * 0.9, FlxG.height * 0.9).loadGraphic(Paths.image('weeb/pixelUI/hand_textbox'));
|
||||
add(handSelect);
|
||||
|
||||
|
||||
if (!talkingRight)
|
||||
{
|
||||
// box.flipX = true;
|
||||
}
|
||||
|
||||
dropText = new FlxText(242, 502, Std.int(FlxG.width * 0.6), "", 32);
|
||||
dropText.font = 'Pixel Arial 11 Bold';
|
||||
dropText.color = 0xFFD89494;
|
||||
add(dropText);
|
||||
|
||||
swagDialogue = new FlxTypeText(240, 500, Std.int(FlxG.width * 0.6), "", 32);
|
||||
swagDialogue.font = 'Pixel Arial 11 Bold';
|
||||
swagDialogue.color = 0xFF3F2021;
|
||||
swagDialogue.sounds = [FlxG.sound.load(Paths.sound('pixelText'), 0.6)];
|
||||
add(swagDialogue);
|
||||
|
||||
dialogue = new Alphabet(0, 80, "", false, true);
|
||||
// dialogue.x = 90;
|
||||
// add(dialogue);
|
||||
}
|
||||
|
||||
var dialogueOpened:Bool = false;
|
||||
var dialogueStarted:Bool = false;
|
||||
|
||||
override function update(elapsed:Float)
|
||||
{
|
||||
// HARD CODING CUZ IM STUPDI
|
||||
if (PlayState.SONG.song.toLowerCase() == 'roses')
|
||||
portraitLeft.visible = false;
|
||||
if (PlayState.SONG.song.toLowerCase() == 'thorns')
|
||||
{
|
||||
portraitLeft.color = FlxColor.BLACK;
|
||||
swagDialogue.color = FlxColor.WHITE;
|
||||
dropText.color = FlxColor.BLACK;
|
||||
}
|
||||
|
||||
dropText.text = swagDialogue.text;
|
||||
|
||||
if (box.animation.curAnim != null)
|
||||
{
|
||||
if (box.animation.curAnim.name == 'normalOpen' && box.animation.curAnim.finished)
|
||||
{
|
||||
box.animation.play('normal');
|
||||
dialogueOpened = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (dialogueOpened && !dialogueStarted)
|
||||
{
|
||||
startDialogue();
|
||||
dialogueStarted = true;
|
||||
}
|
||||
|
||||
if (FlxG.keys.justPressed.ANY && dialogueStarted == true)
|
||||
{
|
||||
remove(dialogue);
|
||||
|
||||
FlxG.sound.play(Paths.sound('clickText'), 0.8);
|
||||
|
||||
if (dialogueList[1] == null && dialogueList[0] != null)
|
||||
{
|
||||
if (!isEnding)
|
||||
{
|
||||
isEnding = true;
|
||||
|
||||
if (PlayState.SONG.song.toLowerCase() == 'senpai' || PlayState.SONG.song.toLowerCase() == 'thorns')
|
||||
FlxG.sound.music.fadeOut(2.2, 0);
|
||||
|
||||
new FlxTimer().start(0.2, function(tmr:FlxTimer)
|
||||
{
|
||||
box.alpha -= 1 / 5;
|
||||
bgFade.alpha -= 1 / 5 * 0.7;
|
||||
portraitLeft.visible = false;
|
||||
portraitRight.visible = false;
|
||||
swagDialogue.alpha -= 1 / 5;
|
||||
dropText.alpha = swagDialogue.alpha;
|
||||
}, 5);
|
||||
|
||||
new FlxTimer().start(1.2, function(tmr:FlxTimer)
|
||||
{
|
||||
finishThing();
|
||||
kill();
|
||||
});
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dialogueList.remove(dialogueList[0]);
|
||||
startDialogue();
|
||||
}
|
||||
}
|
||||
|
||||
super.update(elapsed);
|
||||
}
|
||||
|
||||
var isEnding:Bool = false;
|
||||
|
||||
function startDialogue():Void
|
||||
{
|
||||
cleanDialog();
|
||||
// var theDialog:Alphabet = new Alphabet(0, 70, dialogueList[0], false, true);
|
||||
// dialogue = theDialog;
|
||||
// add(theDialog);
|
||||
|
||||
// swagDialogue.text = ;
|
||||
swagDialogue.resetText(dialogueList[0]);
|
||||
swagDialogue.start(0.04, true);
|
||||
|
||||
switch (curCharacter)
|
||||
{
|
||||
case 'dad':
|
||||
portraitRight.visible = false;
|
||||
if (!portraitLeft.visible)
|
||||
{
|
||||
portraitLeft.visible = true;
|
||||
portraitLeft.animation.play('enter');
|
||||
}
|
||||
case 'bf':
|
||||
portraitLeft.visible = false;
|
||||
if (!portraitRight.visible)
|
||||
{
|
||||
portraitRight.visible = true;
|
||||
portraitRight.animation.play('enter');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function cleanDialog():Void
|
||||
{
|
||||
var splitName:Array<String> = dialogueList[0].split(":");
|
||||
curCharacter = splitName[1];
|
||||
dialogueList[0] = dialogueList[0].substr(splitName[1].length + 2).trim();
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,7 @@ import flixel.FlxG;
|
||||
// TODO: REMOVE TEST
|
||||
import modsfolder.ModsFolder;
|
||||
|
||||
@:build(funkin.macros.BuildCounterMacro.build())
|
||||
class Main extends Sprite
|
||||
{
|
||||
var gameWidth:Int = 1280; // Width of the game in pixels (might be less / more in actual pixels depending on your zoom).
|
||||
@@ -88,5 +89,7 @@ class Main extends Sprite
|
||||
|
||||
ModsFolder.loadMod("B-Sides");
|
||||
ModsFolder.currentModFolder = "B-Sides";
|
||||
|
||||
FlxG.fixedTimestep = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,9 +95,11 @@ class MainMenuState extends MusicBeatState
|
||||
|
||||
FlxG.camera.follow(camFollow, null, 0.06);
|
||||
|
||||
var versionShit:FlxText = new FlxText(5, FlxG.height - 18, 0, "v" + Application.current.meta.get('version'), 12);
|
||||
trace(Main.buildNumber);
|
||||
var versionShit:FlxText = new FlxText(5, FlxG.height - 2, 0, 'Codename Engine v${Application.current.meta.get('version')}\r\nPre-Alpha: Build ${Main.buildNumber}', 12);
|
||||
versionShit.scrollFactor.set();
|
||||
versionShit.setFormat("VCR OSD Mono", 16, FlxColor.WHITE, LEFT, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK);
|
||||
versionShit.y -= versionShit.height;
|
||||
add(versionShit);
|
||||
|
||||
// NG.core.calls.event.logEvent('swag').send();
|
||||
@@ -183,7 +185,7 @@ class MainMenuState extends MusicBeatState
|
||||
case 'options':
|
||||
FlxTransitionableState.skipNextTransIn = true;
|
||||
FlxTransitionableState.skipNextTransOut = true;
|
||||
FlxG.switchState(new OptionsMenu());
|
||||
// FlxG.switchState(new OptionsMenu());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -14,6 +14,8 @@ class MusicBeatState extends FlxUIState
|
||||
|
||||
private var curStep:Int = 0;
|
||||
private var curBeat:Int = 0;
|
||||
private var curStepFloat:Float = 0;
|
||||
private var curBeatFloat:Float = 0;
|
||||
private var controls(get, never):Controls;
|
||||
|
||||
inline function get_controls():Controls
|
||||
@@ -43,7 +45,7 @@ class MusicBeatState extends FlxUIState
|
||||
|
||||
private function updateBeat():Void
|
||||
{
|
||||
curBeat = Math.floor(curStep / 4);
|
||||
curBeat = Math.floor(curBeatFloat = (curStep / 4));
|
||||
}
|
||||
|
||||
private function updateCurStep():Void
|
||||
@@ -59,7 +61,7 @@ class MusicBeatState extends FlxUIState
|
||||
lastChange = Conductor.bpmChangeMap[i];
|
||||
}
|
||||
|
||||
curStep = lastChange.stepTime + Math.floor((Conductor.songPosition - lastChange.songTime) / Conductor.stepCrochet);
|
||||
curStep = Math.floor(curStepFloat = lastChange.stepTime + ((Conductor.songPosition - lastChange.songTime) / Conductor.stepCrochet));
|
||||
}
|
||||
|
||||
public function stepHit():Void
|
||||
|
||||
@@ -1,130 +0,0 @@
|
||||
package;
|
||||
|
||||
import Controls.Control;
|
||||
import flash.text.TextField;
|
||||
import flixel.FlxG;
|
||||
import flixel.FlxSprite;
|
||||
import flixel.addons.display.FlxGridOverlay;
|
||||
import flixel.group.FlxGroup.FlxTypedGroup;
|
||||
import flixel.input.keyboard.FlxKey;
|
||||
import flixel.math.FlxMath;
|
||||
import flixel.text.FlxText;
|
||||
import flixel.util.FlxColor;
|
||||
import lime.utils.Assets;
|
||||
|
||||
class OptionsMenu extends MusicBeatState
|
||||
{
|
||||
var selector:FlxText;
|
||||
var curSelected:Int = 0;
|
||||
|
||||
var controlsStrings:Array<String> = [];
|
||||
|
||||
private var grpControls:FlxTypedGroup<Alphabet>;
|
||||
|
||||
override function create()
|
||||
{
|
||||
var menuBG:FlxSprite = new FlxSprite().loadGraphic(Paths.image('menuDesat'));
|
||||
controlsStrings = CoolUtil.coolTextFile(Paths.txt('controls'));
|
||||
menuBG.color = 0xFFea71fd;
|
||||
menuBG.setGraphicSize(Std.int(menuBG.width * 1.1));
|
||||
menuBG.updateHitbox();
|
||||
menuBG.screenCenter();
|
||||
menuBG.antialiasing = true;
|
||||
add(menuBG);
|
||||
|
||||
/*
|
||||
grpControls = new FlxTypedGroup<Alphabet>();
|
||||
add(grpControls);
|
||||
|
||||
for (i in 0...controlsStrings.length)
|
||||
{
|
||||
if (controlsStrings[i].indexOf('set') != -1)
|
||||
{
|
||||
var controlLabel:Alphabet = new Alphabet(0, (70 * i) + 30, controlsStrings[i].substring(3) + ': ' + controlsStrings[i + 1], true, false);
|
||||
controlLabel.isMenuItem = true;
|
||||
controlLabel.targetY = i;
|
||||
grpControls.add(controlLabel);
|
||||
}
|
||||
// DONT PUT X IN THE FIRST PARAMETER OF new ALPHABET() !!
|
||||
}
|
||||
*/
|
||||
|
||||
super.create();
|
||||
|
||||
openSubState(new OptionsSubState());
|
||||
}
|
||||
|
||||
override function update(elapsed:Float)
|
||||
{
|
||||
super.update(elapsed);
|
||||
|
||||
/*
|
||||
if (controls.ACCEPT)
|
||||
{
|
||||
changeBinding();
|
||||
}
|
||||
|
||||
if (isSettingControl)
|
||||
waitingInput();
|
||||
else
|
||||
{
|
||||
if (controls.BACK)
|
||||
FlxG.switchState(new MainMenuState());
|
||||
if (controls.UP_P)
|
||||
changeSelection(-1);
|
||||
if (controls.DOWN_P)
|
||||
changeSelection(1);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
function waitingInput():Void
|
||||
{
|
||||
if (FlxG.keys.getIsDown().length > 0)
|
||||
{
|
||||
PlayerSettings.player1.controls.replaceBinding(Control.LEFT, Keys, FlxG.keys.getIsDown()[0].ID, null);
|
||||
}
|
||||
// PlayerSettings.player1.controls.replaceBinding(Control)
|
||||
}
|
||||
|
||||
var isSettingControl:Bool = false;
|
||||
|
||||
function changeBinding():Void
|
||||
{
|
||||
if (!isSettingControl)
|
||||
{
|
||||
isSettingControl = true;
|
||||
}
|
||||
}
|
||||
|
||||
function changeSelection(change:Int = 0)
|
||||
{
|
||||
FlxG.sound.play(Paths.sound('scrollMenu'), 0.4);
|
||||
|
||||
curSelected += change;
|
||||
|
||||
if (curSelected < 0)
|
||||
curSelected = grpControls.length - 1;
|
||||
if (curSelected >= grpControls.length)
|
||||
curSelected = 0;
|
||||
|
||||
// selector.y = (70 * curSelected) + 30;
|
||||
|
||||
var bullShit:Int = 0;
|
||||
|
||||
for (item in grpControls.members)
|
||||
{
|
||||
item.targetY = bullShit - curSelected;
|
||||
bullShit++;
|
||||
|
||||
item.alpha = 0.6;
|
||||
// item.setGraphicSize(Std.int(item.width * 0.8));
|
||||
|
||||
if (item.targetY == 0)
|
||||
{
|
||||
item.alpha = 1;
|
||||
// item.setGraphicSize(Std.int(item.width));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
package;
|
||||
|
||||
import flixel.FlxG;
|
||||
import flixel.FlxSprite;
|
||||
import flixel.group.FlxGroup.FlxTypedGroup;
|
||||
import flixel.text.FlxText;
|
||||
import flixel.util.FlxColor;
|
||||
|
||||
class OptionsSubState extends MusicBeatSubstate
|
||||
{
|
||||
var textMenuItems:Array<String> = ['Master Volume', 'Sound Volume', 'Controls'];
|
||||
|
||||
var selector:FlxSprite;
|
||||
var curSelected:Int = 0;
|
||||
|
||||
var grpOptionsTexts:FlxTypedGroup<FlxText>;
|
||||
|
||||
public function new()
|
||||
{
|
||||
super();
|
||||
|
||||
grpOptionsTexts = new FlxTypedGroup<FlxText>();
|
||||
add(grpOptionsTexts);
|
||||
|
||||
selector = new FlxSprite().makeGraphic(5, 5, FlxColor.RED);
|
||||
add(selector);
|
||||
|
||||
for (i in 0...textMenuItems.length)
|
||||
{
|
||||
var optionText:FlxText = new FlxText(20, 20 + (i * 50), 0, textMenuItems[i], 32);
|
||||
optionText.ID = i;
|
||||
grpOptionsTexts.add(optionText);
|
||||
}
|
||||
}
|
||||
|
||||
override function update(elapsed:Float)
|
||||
{
|
||||
super.update(elapsed);
|
||||
|
||||
if (controls.UP_P)
|
||||
curSelected -= 1;
|
||||
|
||||
if (controls.DOWN_P)
|
||||
curSelected += 1;
|
||||
|
||||
if (curSelected < 0)
|
||||
curSelected = textMenuItems.length - 1;
|
||||
|
||||
if (curSelected >= textMenuItems.length)
|
||||
curSelected = 0;
|
||||
|
||||
grpOptionsTexts.forEach(function(txt:FlxText)
|
||||
{
|
||||
txt.color = FlxColor.WHITE;
|
||||
|
||||
if (txt.ID == curSelected)
|
||||
txt.color = FlxColor.YELLOW;
|
||||
});
|
||||
|
||||
if (controls.ACCEPT)
|
||||
{
|
||||
switch (textMenuItems[curSelected])
|
||||
{
|
||||
case "Controls":
|
||||
FlxG.state.closeSubState();
|
||||
FlxG.state.openSubState(new ControlsSubState());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
-2465
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,4 @@
|
||||
package;
|
||||
package funkin.game;
|
||||
|
||||
import flixel.FlxSprite;
|
||||
import flixel.graphics.frames.FlxAtlasFrames;
|
||||
@@ -21,6 +21,13 @@ class Note extends FlxSprite
|
||||
public var wasGoodHit:Bool = false;
|
||||
public var prevNote:Note;
|
||||
|
||||
public var strumID(get, never):Int;
|
||||
private function get_strumID() {
|
||||
var id = noteData % 4;
|
||||
if (id < 0) id = 0;
|
||||
return id;
|
||||
}
|
||||
|
||||
public var sustainLength:Float = 0;
|
||||
public var isSustainNote:Bool = false;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,56 @@
|
||||
package funkin.game;
|
||||
|
||||
import flixel.FlxSprite;
|
||||
import flixel.math.FlxMath;
|
||||
|
||||
class Strum extends FlxSprite {
|
||||
public var cpu = false;
|
||||
public var lastHit:Float = -5000;
|
||||
|
||||
public override function update(elapsed:Float) {
|
||||
super.update(elapsed);
|
||||
if (cpu) {
|
||||
if (lastHit + (Conductor.crochet) < Conductor.songPosition && getAnim() == "confirm") {
|
||||
playAnim("static");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function updateNotePosition(daNote:Note) {
|
||||
daNote.y = (y - (Conductor.songPosition - daNote.strumTime) * (0.45 * FlxMath.roundDecimal(PlayState.SONG.speed, 2)));
|
||||
daNote.x = x;
|
||||
}
|
||||
|
||||
public function updatePlayerInput(pressed:Bool, justPressed:Bool, justReleased:Bool) {
|
||||
switch(getAnim()) {
|
||||
case "confirm":
|
||||
if (justReleased || !pressed)
|
||||
playAnim("static");
|
||||
case "pressed":
|
||||
if (justReleased || !pressed)
|
||||
playAnim("static");
|
||||
case "static":
|
||||
if (justPressed || pressed)
|
||||
playAnim("pressed");
|
||||
case null:
|
||||
playAnim("static");
|
||||
}
|
||||
centerOffsets();
|
||||
centerOrigin();
|
||||
}
|
||||
|
||||
public function press(time:Float) {
|
||||
lastHit = time;
|
||||
playAnim("confirm");
|
||||
centerOffsets();
|
||||
centerOrigin();
|
||||
}
|
||||
|
||||
public function playAnim(anim:String, force:Bool = true) {
|
||||
var oldAnim = animation.curAnim;
|
||||
animation.play(anim, force);
|
||||
}
|
||||
public function getAnim() {
|
||||
return animation.curAnim == null ? null : animation.curAnim.name;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package funkin.macros;
|
||||
|
||||
import haxe.macro.Expr.Field;
|
||||
import haxe.macro.Context;
|
||||
import sys.io.File;
|
||||
|
||||
class BuildCounterMacro {
|
||||
public static function build():Array<Field> {
|
||||
var buildNum:Int = Std.parseInt(File.getContent("buildnumber.txt"));
|
||||
buildNum++;
|
||||
|
||||
var fields = Context.getBuildFields();
|
||||
fields.push({
|
||||
name: "buildNumber",
|
||||
access: [APublic, AStatic, AInline],
|
||||
kind: FieldType.FVar(macro:Int, macro $v{buildNum}),
|
||||
pos: Context.currentPos(),
|
||||
});
|
||||
File.saveContent("buildnumber.txt", Std.string(buildNum));
|
||||
return fields;
|
||||
}
|
||||
}
|
||||
+4
-1
@@ -1 +1,4 @@
|
||||
import Paths;
|
||||
#if !macro
|
||||
import Paths;
|
||||
import funkin.game.PlayState;
|
||||
#end
|
||||
Reference in New Issue
Block a user