diff --git a/appveyor-linux.yml b/appveyor-linux.yml
index 8cc98de..6dfee0f 100644
--- a/appveyor-linux.yml
+++ b/appveyor-linux.yml
@@ -9,7 +9,7 @@ install:
- cd /home/appveyor
- sudo add-apt-repository ppa:haxe/releases -y
- sudo apt update
- - sudo apt install neko tar -y
+ - sudo apt install neko tar gcc-7 g++-7 gcc-7-multilib g++-7-multilib -y
- wget https://github.com/HaxeFoundation/haxe/releases/download/4.1.5/haxe-4.1.5-linux64.tar.gz
- mkdir $HAXE_INSTALLDIR
- tar -xf haxe-4.1.5-linux64.tar.gz -C $HAXE_INSTALLDIR
@@ -32,7 +32,6 @@ install:
- haxelib run lime rebuild extension-webm linux
- haxelib install linc_luajit
- haxelib install actuate
- - haxelib git extension-webm https://github.com/KadeDev/extension-webm
- haxelib list
- cd /home/appveyor/projects/kade-engine-linux
diff --git a/appveyor-windows.yml b/appveyor-windows.yml
index eaf9b74..ae69bca 100644
--- a/appveyor-windows.yml
+++ b/appveyor-windows.yml
@@ -37,8 +37,9 @@ install:
- haxelib run lime rebuild extension-webm windows
- haxelib install linc_luajit
- haxelib install actuate
- - haxelib git extension-webm https://github.com/KadeDev/extension-webm
- - lime rebuild extension-webm windows
+ #- haxelib git extension-webm https://github.com/KadeDev/extension-webm
+ #- haxelib run lime rebuild extension-webm windows
+ #why here's dublicate lmao
- haxelib list
# No tests idk lol
diff --git a/assets/shared/images/NOTE_assets.png b/assets/shared/images/NOTE_assets.png
index 7d50636..8e9f3a0 100644
Binary files a/assets/shared/images/NOTE_assets.png and b/assets/shared/images/NOTE_assets.png differ
diff --git a/assets/shared/images/NOTE_assets.xml b/assets/shared/images/NOTE_assets.xml
index 82a997a..6e80b13 100644
--- a/assets/shared/images/NOTE_assets.xml
+++ b/assets/shared/images/NOTE_assets.xml
@@ -1,53 +1,92 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/source/Caching.hx b/source/Caching.hx
index 2c6fb50..1cbbcd6 100644
--- a/source/Caching.hx
+++ b/source/Caching.hx
@@ -83,6 +83,7 @@ class Caching extends MusicBeatState
var images = [];
var music = [];
+ var charts = [];
trace("caching images...");
@@ -99,6 +100,7 @@ class Caching extends MusicBeatState
{
music.push(i);
}
+
toBeDone = Lambda.count(images) + Lambda.count(music);
@@ -120,6 +122,7 @@ class Caching extends MusicBeatState
done++;
}
+
trace("Finished caching...");
FlxG.switchState(new TitleState());
diff --git a/source/DiffCalc.hx b/source/DiffCalc.hx
new file mode 100644
index 0000000..cd7bcf8
--- /dev/null
+++ b/source/DiffCalc.hx
@@ -0,0 +1,92 @@
+import Song.SwagSong;
+
+class SmallNote // basically Note.hx but small as fuck
+{
+ public var strumTime:Float;
+ public var noteData:Int;
+
+ public function new(strum,data)
+ {
+ strumTime = strum;
+ noteData = data;
+ }
+}
+
+class DiffCalc
+{
+ public static function CalculateDiff(song:SwagSong)
+ {
+ // cleaned notes
+ var cleanedNotes:Array = [];
+
+ // find all of the notes
+ for(i in song.notes) // sections
+ {
+ for (ii in i.sectionNotes) // notes
+ {
+ if (ii[2] != 0) // skip helds
+ continue;
+ var gottaHitNote:Bool = i.mustHitSection;
+
+ if (ii[1] > 3)
+ gottaHitNote = !i.mustHitSection;
+
+ if (gottaHitNote)
+ cleanedNotes.push(new SmallNote(ii[0],ii[1]));
+ }
+ }
+
+ cleanedNotes.sort((a, b) -> Std.int(a.strumTime - b.strumTime));
+
+ var firstNoteTime = cleanedNotes[0].strumTime;
+
+ // normalize the notes
+ for(i in cleanedNotes)
+ {
+ i.strumTime = (i.strumTime - firstNoteTime) * 2;
+ }
+
+ // length in segments of the song
+ var length = ((cleanedNotes[cleanedNotes.length - 1].strumTime / 1000) / 0.5);
+
+ // hackey way of creating a array with a length
+ var segments:Array = new_Array(1,Std.int(length));
+
+ // algo loop
+ for(i in cleanedNotes)
+ {
+ var index = Std.int(((i.strumTime / 1000)));
+ if (index + 1 > segments.length)
+ continue;
+ segments[index] = segments[index] + 1;
+ }
+
+ // get the average of all of the segments
+ var sum:Float = 0;
+
+ var newLength = segments.length;
+
+ for (i in segments)
+ {
+ if (i == 0) // remove empty/breaks
+ {
+ newLength--;
+ continue;
+ }
+ //trace(i);
+ sum += i / .5; // half it because otherwise instead of nps its just fucking notes per half second which is dumb and stupid
+ }
+ return HelperFunctions.truncateFloat(sum / newLength,2);
+ }
+
+ static public function new_Array( ArrayType:T, Length:Int ):Array {
+ var empty:Null = null;
+ var newArray:Array = new Array();
+
+ for ( i in 0...Length ) {
+ newArray.push( empty );
+ }
+
+ return newArray;
+ }
+}
\ No newline at end of file
diff --git a/source/FreeplayState.hx b/source/FreeplayState.hx
index 243d970..b939a1f 100644
--- a/source/FreeplayState.hx
+++ b/source/FreeplayState.hx
@@ -1,5 +1,6 @@
package;
+import Song.SwagSong;
import flixel.input.gamepad.FlxGamepad;
import flash.text.TextField;
import flixel.FlxG;
@@ -29,6 +30,7 @@ class FreeplayState extends MusicBeatState
var scoreText:FlxText;
var comboText:FlxText;
var diffText:FlxText;
+ var diffCalcText:FlxText;
var lerpScore:Int = 0;
var intendedScore:Int = 0;
var combo:String = '';
@@ -38,16 +40,48 @@ class FreeplayState extends MusicBeatState
private var iconArray:Array = [];
+ public static var songData:Map> = [];
+
+ public static function loadDiff(diff:Int, format:String, name:String, array:Array)
+ {
+ try
+ {
+ array.push(Song.loadFromJson(Highscore.formatSong(format, diff), name));
+ }
+ catch(ex)
+ {
+ // do nada
+ }
+ }
+
override function create()
{
var initSonglist = CoolUtil.coolTextFile(Paths.txt('freeplaySonglist'));
+ //var diffList = "";
+
for (i in 0...initSonglist.length)
{
var data:Array = initSonglist[i].split(':');
- songs.push(new SongMetadata(data[0], Std.parseInt(data[2]), data[1]));
+ var meta = new SongMetadata(data[0], Std.parseInt(data[2]), data[1]);
+ songs.push(meta);
+ var format = StringTools.replace(meta.songName, " ", "-");
+ switch (format) {
+ case 'Dad-Battle': format = 'Dadbattle';
+ case 'Philly-Nice': format = 'Philly';
+ }
+
+ var diffs = [];
+ FreeplayState.loadDiff(0,format,meta.songName,diffs);
+ FreeplayState.loadDiff(1,format,meta.songName,diffs);
+ FreeplayState.loadDiff(2,format,meta.songName,diffs);
+ FreeplayState.songData.set(meta.songName,diffs);
+ trace('loaded diffs for ' + meta.songName);
+ //diffList += meta.songName + "\nEasy: " + DiffCalc.CalculateDiff(songData.get(meta.songName)[0]) + "\nNormal: " + DiffCalc.CalculateDiff(songData.get(meta.songName)[1]) + "\nHard: " + DiffCalc.CalculateDiff(songData.get(meta.songName)[2]) + "\n\n";
}
+ //trace("\n" + diffList);
+
/*
if (FlxG.sound.music != null)
{
@@ -101,7 +135,7 @@ class FreeplayState extends MusicBeatState
scoreText.setFormat(Paths.font("vcr.ttf"), 32, FlxColor.WHITE, RIGHT);
// scoreText.alignment = RIGHT;
- var scoreBG:FlxSprite = new FlxSprite(scoreText.x - 6, 0).makeGraphic(Std.int(FlxG.width * 0.35), 66, 0xFF000000);
+ var scoreBG:FlxSprite = new FlxSprite(scoreText.x - 6, 0).makeGraphic(Std.int(FlxG.width * 0.35), 105, 0xFF000000);
scoreBG.alpha = 0.6;
add(scoreBG);
@@ -109,6 +143,10 @@ class FreeplayState extends MusicBeatState
diffText.font = scoreText.font;
add(diffText);
+ diffCalcText = new FlxText(scoreText.x, scoreText.y + 66, 0, "", 24);
+ diffCalcText.font = scoreText.font;
+ add(diffCalcText);
+
comboText = new FlxText(diffText.x + 100, diffText.y, 0, "", 24);
comboText.font = diffText.font;
add(comboText);
@@ -238,14 +276,20 @@ class FreeplayState extends MusicBeatState
case 'Dad-Battle': songFormat = 'Dadbattle';
case 'Philly-Nice': songFormat = 'Philly';
}
-
- trace(songs[curSelected].songName);
+ var hmm;
+ try
+ {
+ hmm = songData.get(songs[curSelected].songName)[curDifficulty];
+ if (hmm == null)
+ return;
+ }
+ catch(ex)
+ {
+ return;
+ }
- var poop:String = Highscore.formatSong(songFormat, curDifficulty);
- trace(poop);
-
- PlayState.SONG = Song.loadFromJson(poop, songs[curSelected].songName);
+ PlayState.SONG = hmm;
PlayState.isStoryMode = false;
PlayState.storyDifficulty = curDifficulty;
PlayState.storyWeek = songs[curSelected].week;
@@ -274,7 +318,7 @@ class FreeplayState extends MusicBeatState
intendedScore = Highscore.getScore(songHighscore, curDifficulty);
combo = Highscore.getCombo(songHighscore, curDifficulty);
#end
-
+ diffCalcText.text = 'RATING: ${DiffCalc.CalculateDiff(songData.get(songs[curSelected].songName)[curDifficulty])}';
diffText.text = CoolUtil.difficultyFromInt(curDifficulty).toUpperCase();
}
@@ -310,6 +354,8 @@ class FreeplayState extends MusicBeatState
// lerpScore = 0;
#end
+ diffCalcText.text = 'RATING: ${DiffCalc.CalculateDiff(songData.get(songs[curSelected].songName)[curDifficulty])}';
+
#if PRELOAD_ALL
FlxG.sound.playMusic(Paths.inst(songs[curSelected].songName), 0);
#end
diff --git a/source/KeyBinds.hx b/source/KeyBinds.hx
index 2514ea1..b9c704d 100644
--- a/source/KeyBinds.hx
+++ b/source/KeyBinds.hx
@@ -72,8 +72,12 @@ class KeyBinds
FlxG.save.data.gprightBind = "DPAD_RIGHT";
trace("No GRIGHT");
}
+ if(FlxG.save.data.killBind == null){
+ FlxG.save.data.killBind = "R";
+ trace("No KILL");
+ }
trace('${FlxG.save.data.leftBind}-${FlxG.save.data.downBind}-${FlxG.save.data.upBind}-${FlxG.save.data.rightBind}');
}
-}
\ No newline at end of file
+}
diff --git a/source/Note.hx b/source/Note.hx
index cdb9cb2..ec67490 100644
--- a/source/Note.hx
+++ b/source/Note.hx
@@ -99,20 +99,20 @@ class Note extends FlxSprite
default:
frames = Paths.getSparrowAtlas('NOTE_assets');
- animation.addByPrefix('greenScroll', 'green0');
- animation.addByPrefix('redScroll', 'red0');
- animation.addByPrefix('blueScroll', 'blue0');
- animation.addByPrefix('purpleScroll', 'purple0');
+ animation.addByPrefix('greenScroll', 'green instance 1');
+ animation.addByPrefix('redScroll', 'red instance 1');
+ animation.addByPrefix('blueScroll', 'blue instance 1');
+ animation.addByPrefix('purpleScroll', 'purple instance 1');
- animation.addByPrefix('purpleholdend', 'pruple end hold');
- animation.addByPrefix('greenholdend', 'green hold end');
- animation.addByPrefix('redholdend', 'red hold end');
- animation.addByPrefix('blueholdend', 'blue hold end');
+ animation.addByPrefix('purpleholdend', 'pruple end hold instance 1');
+ animation.addByPrefix('greenholdend', 'green hold end instance 1');
+ animation.addByPrefix('redholdend', 'red hold end instance 1');
+ animation.addByPrefix('blueholdend', 'blue hold end instance 1');
- animation.addByPrefix('purplehold', 'purple hold piece');
- animation.addByPrefix('greenhold', 'green hold piece');
- animation.addByPrefix('redhold', 'red hold piece');
- animation.addByPrefix('bluehold', 'blue hold piece');
+ animation.addByPrefix('purplehold', 'purple hold piece instance 1');
+ animation.addByPrefix('greenhold', 'green hold piece instance 1');
+ animation.addByPrefix('redhold', 'red hold piece instance 1');
+ animation.addByPrefix('bluehold', 'blue hold piece instance 1');
setGraphicSize(Std.int(width * 0.7));
updateHitbox();
@@ -235,4 +235,4 @@ class Note extends FlxSprite
alpha = 0.3;
}
}
-}
\ No newline at end of file
+}
diff --git a/source/PauseSubState.hx b/source/PauseSubState.hx
index 8d0c323..f2e3a0b 100644
--- a/source/PauseSubState.hx
+++ b/source/PauseSubState.hx
@@ -111,19 +111,18 @@ class PauseSubState extends MusicBeatSubstate
var gamepad:FlxGamepad = FlxG.gamepads.lastActive;
- var upP = controls.UP_P;
- var downP = controls.DOWN_P;
- var leftP = controls.LEFT_P;
- var rightP = controls.RIGHT_P;
- var accepted = controls.ACCEPT;
+ var upPcontroller:Bool = false;
+ var downPcontroller:Bool = false;
+ var leftPcontroller:Bool = false;
+ var rightPcontroller:Bool = false;
var oldOffset:Float = 0;
if (gamepad != null && KeyBinds.gamepad)
{
- upP = gamepad.justPressed.DPAD_UP;
- downP = gamepad.justPressed.DPAD_DOWN;
- leftP = gamepad.justPressed.DPAD_LEFT;
- rightP = gamepad.justPressed.DPAD_RIGHT;
+ upPcontroller = gamepad.justPressed.DPAD_UP;
+ downPcontroller = gamepad.justPressed.DPAD_DOWN;
+ leftPcontroller = gamepad.justPressed.DPAD_LEFT;
+ rightPcontroller = gamepad.justPressed.DPAD_RIGHT;
}
// pre lowercasing the song name (update)
@@ -134,17 +133,18 @@ class PauseSubState extends MusicBeatSubstate
}
var songPath = 'assets/data/' + songLowercase + '/';
- if (upP)
+ if (controls.UP_P || upPcontroller)
{
changeSelection(-1);
- }else if (downP)
+ }
+ else if (controls.DOWN_P || downPcontroller)
{
changeSelection(1);
}
#if cpp
- else if (leftP)
+ else if (controls.LEFT_P || leftPcontroller)
{
oldOffset = PlayState.songOffset;
PlayState.songOffset -= 1;
@@ -171,7 +171,8 @@ class PauseSubState extends MusicBeatSubstate
cameras = [FlxG.cameras.list[FlxG.cameras.list.length - 1]];
offsetChanged = true;
}
- }else if (rightP)
+ }
+ else if (controls.RIGHT_P || rightPcontroller)
{
oldOffset = PlayState.songOffset;
PlayState.songOffset += 1;
@@ -199,7 +200,7 @@ class PauseSubState extends MusicBeatSubstate
}
#end
- if (accepted)
+ if (controls.ACCEPT)
{
var daSelected:String = menuItems[curSelected];
diff --git a/source/PlayState.hx b/source/PlayState.hx
index 4e3a832..daca7ed 100644
--- a/source/PlayState.hx
+++ b/source/PlayState.hx
@@ -1129,6 +1129,7 @@ class PlayState extends MusicBeatState
rep = new Replay("na");
FlxG.stage.addEventListener(KeyboardEvent.KEY_DOWN,handleInput);
+ FlxG.stage.addEventListener(KeyboardEvent.KEY_UP,releaseInput);
super.create();
}
@@ -1368,6 +1369,41 @@ class PlayState extends MusicBeatState
return null;
}
+ var keys = [false,false,false,false];
+
+ private function releaseInput(evt:KeyboardEvent):Void // handles releases
+ {
+ @:privateAccess
+ var key = FlxKey.toStringMap.get(Keyboard.__convertKeyCode(evt.keyCode));
+
+ var binds:Array = [FlxG.save.data.leftBind,FlxG.save.data.downBind, FlxG.save.data.upBind, FlxG.save.data.rightBind];
+
+ var data = -1;
+
+ switch(evt.keyCode) // arrow keys
+ {
+ case 37:
+ data = 0;
+ case 40:
+ data = 1;
+ case 38:
+ data = 2;
+ case 39:
+ data = 3;
+ }
+
+ for (i in 0...binds.length) // binds
+ {
+ if (binds[i].toLowerCase() == key.toLowerCase())
+ data = i;
+ }
+
+ if (data == -1)
+ return;
+
+ keys[data] = false;
+ }
+
private function handleInput(evt:KeyboardEvent):Void { // this actually handles press inputs
if (PlayStateChangeables.botPlay || loadRep || paused)
@@ -1401,15 +1437,16 @@ class PlayState extends MusicBeatState
if (binds[i].toLowerCase() == key.toLowerCase())
data = i;
}
-
- if (evt.keyLocation == KeyLocation.NUM_PAD)
- {
- trace(String.fromCharCode(evt.charCode) + " " + key);
- }
-
if (data == -1)
return;
+ if (keys[data])
+ {
+ return;
+ }
+
+ keys[data] = true;
+
var ana = new Ana(Conductor.songPosition, null, false, "miss", data);
var dataNotes = [];
@@ -1421,7 +1458,7 @@ class PlayState extends MusicBeatState
dataNotes.sort((a, b) -> Std.int(a.strumTime - b.strumTime)); // sort by the earliest note
-
+
if (dataNotes.length != 0)
{
var coolNote = dataNotes[0];
@@ -1594,6 +1631,7 @@ class PlayState extends MusicBeatState
swagNote.sustainLength = songNotes[2];
swagNote.scrollFactor.set(0, 0);
+
var susLength:Float = swagNote.sustainLength;
susLength = susLength / Conductor.stepCrochet;
@@ -1695,73 +1733,73 @@ class PlayState extends MusicBeatState
babyArrow.animation.add('confirm', [12, 16], 24, false);
}
- case 'normal':
- babyArrow.frames = Paths.getSparrowAtlas('NOTE_assets');
- babyArrow.animation.addByPrefix('green', 'arrowUP');
- babyArrow.animation.addByPrefix('blue', 'arrowDOWN');
- babyArrow.animation.addByPrefix('purple', 'arrowLEFT');
- babyArrow.animation.addByPrefix('red', 'arrowRIGHT');
-
- babyArrow.antialiasing = true;
- babyArrow.setGraphicSize(Std.int(babyArrow.width * 0.7));
-
- switch (Math.abs(i))
- {
- case 0:
- babyArrow.x += Note.swagWidth * 0;
- babyArrow.animation.addByPrefix('static', 'arrowLEFT');
- babyArrow.animation.addByPrefix('pressed', 'left press', 24, false);
- babyArrow.animation.addByPrefix('confirm', 'left confirm', 24, false);
- case 1:
- babyArrow.x += Note.swagWidth * 1;
- babyArrow.animation.addByPrefix('static', 'arrowDOWN');
- babyArrow.animation.addByPrefix('pressed', 'down press', 24, false);
- babyArrow.animation.addByPrefix('confirm', 'down confirm', 24, false);
- case 2:
- babyArrow.x += Note.swagWidth * 2;
- babyArrow.animation.addByPrefix('static', 'arrowUP');
- babyArrow.animation.addByPrefix('pressed', 'up press', 24, false);
- babyArrow.animation.addByPrefix('confirm', 'up confirm', 24, false);
- case 3:
- babyArrow.x += Note.swagWidth * 3;
- babyArrow.animation.addByPrefix('static', 'arrowRIGHT');
- babyArrow.animation.addByPrefix('pressed', 'right press', 24, false);
- babyArrow.animation.addByPrefix('confirm', 'right confirm', 24, false);
- }
+ case 'normal':
+ babyArrow.frames = Paths.getSparrowAtlas('NOTE_assets');
+ babyArrow.animation.addByPrefix('green', 'arrow static instance 1');
+ babyArrow.animation.addByPrefix('blue', 'arrow static instance 2');
+ babyArrow.animation.addByPrefix('purple', 'arrow static instance 3');
+ babyArrow.animation.addByPrefix('red', 'arrow static instance 4');
- default:
- babyArrow.frames = Paths.getSparrowAtlas('NOTE_assets');
- babyArrow.animation.addByPrefix('green', 'arrowUP');
- babyArrow.animation.addByPrefix('blue', 'arrowDOWN');
- babyArrow.animation.addByPrefix('purple', 'arrowLEFT');
- babyArrow.animation.addByPrefix('red', 'arrowRIGHT');
+ babyArrow.antialiasing = true;
+ babyArrow.setGraphicSize(Std.int(babyArrow.width * 0.7));
- babyArrow.antialiasing = true;
- babyArrow.setGraphicSize(Std.int(babyArrow.width * 0.7));
-
- switch (Math.abs(i))
- {
- case 0:
- babyArrow.x += Note.swagWidth * 0;
- babyArrow.animation.addByPrefix('static', 'arrowLEFT');
- babyArrow.animation.addByPrefix('pressed', 'left press', 24, false);
- babyArrow.animation.addByPrefix('confirm', 'left confirm', 24, false);
- case 1:
- babyArrow.x += Note.swagWidth * 1;
- babyArrow.animation.addByPrefix('static', 'arrowDOWN');
- babyArrow.animation.addByPrefix('pressed', 'down press', 24, false);
- babyArrow.animation.addByPrefix('confirm', 'down confirm', 24, false);
- case 2:
- babyArrow.x += Note.swagWidth * 2;
- babyArrow.animation.addByPrefix('static', 'arrowUP');
- babyArrow.animation.addByPrefix('pressed', 'up press', 24, false);
- babyArrow.animation.addByPrefix('confirm', 'up confirm', 24, false);
- case 3:
- babyArrow.x += Note.swagWidth * 3;
- babyArrow.animation.addByPrefix('static', 'arrowRIGHT');
- babyArrow.animation.addByPrefix('pressed', 'right press', 24, false);
- babyArrow.animation.addByPrefix('confirm', 'right confirm', 24, false);
+ switch (Math.abs(i))
+ {
+ case 0:
+ babyArrow.x += Note.swagWidth * 0;
+ babyArrow.animation.addByPrefix('static', 'arrow static instance 1');
+ babyArrow.animation.addByPrefix('pressed', 'left press instance 1', 24, false);
+ babyArrow.animation.addByPrefix('confirm', 'left confirm instance 1', 24, false);
+ case 1:
+ babyArrow.x += Note.swagWidth * 1;
+ babyArrow.animation.addByPrefix('static', 'arrow static instance 2');
+ babyArrow.animation.addByPrefix('pressed', 'down press instance 1', 24, false);
+ babyArrow.animation.addByPrefix('confirm', 'down confirm instance 1', 24, false);
+ case 2:
+ babyArrow.x += Note.swagWidth * 2;
+ babyArrow.animation.addByPrefix('static', 'arrow static instance 4');
+ babyArrow.animation.addByPrefix('pressed', 'up press instance 1', 24, false);
+ babyArrow.animation.addByPrefix('confirm', 'up confirm instance 1', 24, false);
+ case 3:
+ babyArrow.x += Note.swagWidth * 3;
+ babyArrow.animation.addByPrefix('static', 'arrow static instance 3');
+ babyArrow.animation.addByPrefix('pressed', 'right press instance 1', 24, false);
+ babyArrow.animation.addByPrefix('confirm', 'right confirm instance 1', 24, false);
}
+
+ default:
+ babyArrow.frames = Paths.getSparrowAtlas('NOTE_assets');
+ babyArrow.animation.addByPrefix('green', 'arrow static instance 1');
+ babyArrow.animation.addByPrefix('blue', 'arrow static instance 2');
+ babyArrow.animation.addByPrefix('purple', 'arrow static instance 3');
+ babyArrow.animation.addByPrefix('red', 'arrow static instance 4');
+
+ babyArrow.antialiasing = true;
+ babyArrow.setGraphicSize(Std.int(babyArrow.width * 0.7));
+
+ switch (Math.abs(i))
+ {
+ case 0:
+ babyArrow.x += Note.swagWidth * 0;
+ babyArrow.animation.addByPrefix('static', 'arrow static instance 1');
+ babyArrow.animation.addByPrefix('pressed', 'left press instance 1', 24, false);
+ babyArrow.animation.addByPrefix('confirm', 'left confirm instance 1', 24, false);
+ case 1:
+ babyArrow.x += Note.swagWidth * 1;
+ babyArrow.animation.addByPrefix('static', 'arrow static instance 2');
+ babyArrow.animation.addByPrefix('pressed', 'down press instance 1', 24, false);
+ babyArrow.animation.addByPrefix('confirm', 'down confirm instance 1', 24, false);
+ case 2:
+ babyArrow.x += Note.swagWidth * 2;
+ babyArrow.animation.addByPrefix('static', 'arrow static instance 4');
+ babyArrow.animation.addByPrefix('pressed', 'up press instance 1', 24, false);
+ babyArrow.animation.addByPrefix('confirm', 'up confirm instance 1', 24, false);
+ case 3:
+ babyArrow.x += Note.swagWidth * 3;
+ babyArrow.animation.addByPrefix('static', 'arrow static instance 3');
+ babyArrow.animation.addByPrefix('pressed', 'right press instance 1', 24, false);
+ babyArrow.animation.addByPrefix('confirm', 'right confirm instance 1', 24, false);
+ }
}
babyArrow.updateHitbox();
@@ -2041,6 +2079,7 @@ class PlayState extends MusicBeatState
#end
FlxG.switchState(new ChartingState());
FlxG.stage.removeEventListener(KeyboardEvent.KEY_DOWN,handleInput);
+ FlxG.stage.removeEventListener(KeyboardEvent.KEY_UP,releaseInput);
#if windows
if (luaModchart != null)
{
@@ -2093,6 +2132,7 @@ class PlayState extends MusicBeatState
FlxG.switchState(new AnimationDebug(SONG.player2));
FlxG.stage.removeEventListener(KeyboardEvent.KEY_DOWN,handleInput);
+ FlxG.stage.removeEventListener(KeyboardEvent.KEY_UP,releaseInput);
#if windows
if (luaModchart != null)
{
@@ -2106,6 +2146,7 @@ class PlayState extends MusicBeatState
{
FlxG.switchState(new AnimationDebug(SONG.player1));
FlxG.stage.removeEventListener(KeyboardEvent.KEY_DOWN,handleInput);
+ FlxG.stage.removeEventListener(KeyboardEvent.KEY_UP,releaseInput);
#if windows
if (luaModchart != null)
{
@@ -2660,6 +2701,7 @@ class PlayState extends MusicBeatState
function endSong():Void
{
FlxG.stage.removeEventListener(KeyboardEvent.KEY_DOWN,handleInput);
+ FlxG.stage.removeEventListener(KeyboardEvent.KEY_UP,releaseInput);
if (useVideo)
{
GlobalVideo.get().stop();
@@ -3149,6 +3191,8 @@ class PlayState extends MusicBeatState
};
#end
+ var nonCpp = false;
+
// Prevent player input if botplay is on
if(PlayStateChangeables.botPlay)
@@ -3158,6 +3202,10 @@ class PlayState extends MusicBeatState
releaseArray = [false, false, false, false];
}
+ #if !cpp
+ nonCpp = true;
+ #end
+
var anas:Array = [null,null,null,null];
for (i in 0...pressArray.length)
@@ -3174,7 +3222,7 @@ class PlayState extends MusicBeatState
});
}
- if (KeyBinds.gamepad && !FlxG.keys.justPressed.ANY)
+ if ((KeyBinds.gamepad && !FlxG.keys.justPressed.ANY) || nonCpp)
{
// PRESSES, check for note hits
if (pressArray.contains(true) && generatedMusic)