1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2025-03-20 17:09:21 +00:00

Merge branch 'master' of github.com:ninjamuffin99/Funkin-secret

This commit is contained in:
EliteMasterEric 2023-01-02 17:41:19 -05:00
commit 6d233b93e0
9 changed files with 553 additions and 177 deletions

212
hmm.json
View file

@ -1,112 +1,104 @@
{
"dependencies": [
{
"name": "discord_rpc",
"type": "git",
"dir": null,
"ref": "2d83fa8",
"url": "https://github.com/Aidan63/linc_discord-rpc"
},
{
"name": "flixel",
"type": "git",
"dir": null,
"ref": "dev",
"url": "https://github.com/MasterEric/flixel"
},
{
"name": "flixel-addons",
"type": "git",
"dir": null,
"ref": "a3877f0",
"url": "https://github.com/MasterEric/flixel-addons"
},
{
"name": "flixel-addons",
"type": "git",
"dir": null,
"ref": "dev",
"url": "https://github.com/MasterEric/flixel-addons"
},
{
"name": "flixel-ui",
"type": "haxelib",
"version": "2.4.0"
},
{
"name": "flxanimate",
"type": "git",
"dir": null,
"ref": "18b2060",
"url": "https://github.com/Dot-Stuff/flxanimate"
},
{
"name": "format",
"type": "haxelib",
"version": null
},
{
"name": "haxeui-core",
"type": "git",
"dir": null,
"ref": "fc8d656b",
"url": "https://github.com/haxeui/haxeui-core/"
},
{
"name": "haxeui-flixel",
"type": "git",
"dir": null,
"ref": "80941a7",
"url": "https://github.com/haxeui/haxeui-flixel"
},
{
"name": "hmm",
"type": "haxelib",
"version": "2.1.0"
},
{
"name": "hscript",
"type": "haxelib",
"version": "2.5.0"
},
{
"name": "hxcpp",
"type": "haxelib",
"version": "4.2.1"
},
{
"name": "hxcpp-debug-server",
"type": "haxelib",
"version": "1.2.4"
},
{
"name": "hxp",
"type": "haxelib",
"version": null
},
{
"name": "lime",
"type": "haxelib",
"version": null
},
{
"name": "openfl",
"type": "git",
"dir": null,
"ref": "develop",
"url": "https://github.com/openfl/openfl"
},
{
"name": "polymod",
"type": "git",
"dir": null,
"ref": "develop",
"url": "https://github.com/larsiusprime/polymod"
},
{
"name": "thx.semver",
"type": "haxelib",
"version": "0.2.2"
}
]
"dependencies": [{
"name": "discord_rpc",
"type": "git",
"dir": null,
"ref": "2d83fa8",
"url": "https://github.com/Aidan63/linc_discord-rpc"
},
{
"name": "flixel",
"type": "git",
"dir": null,
"ref": "a629f9a5",
"url": "https://github.com/MasterEric/flixel"
},
{
"name": "flixel-addons",
"type": "git",
"dir": null,
"ref": "752c3d7",
"url": "https://github.com/MasterEric/flixel-addons"
},
{
"name": "flixel-ui",
"type": "haxelib",
"version": "2.4.0"
},
{
"name": "flxanimate",
"type": "git",
"dir": null,
"ref": "18b2060",
"url": "https://github.com/Dot-Stuff/flxanimate"
},
{
"name": "format",
"type": "haxelib",
"version": "3.5.0"
},
{
"name": "haxeui-core",
"type": "git",
"dir": null,
"ref": "fc8d656b",
"url": "https://github.com/haxeui/haxeui-core/"
},
{
"name": "haxeui-flixel",
"type": "git",
"dir": null,
"ref": "80941a7",
"url": "https://github.com/haxeui/haxeui-flixel"
},
{
"name": "hmm",
"type": "haxelib",
"version": "2.1.0"
},
{
"name": "hscript",
"type": "haxelib",
"version": "2.5.0"
},
{
"name": "hxcpp",
"type": "haxelib",
"version": "4.2.1"
},
{
"name": "hxcpp-debug-server",
"type": "haxelib",
"version": "1.2.4"
},
{
"name": "hxp",
"type": "haxelib",
"version": "1.2.2"
},
{
"name": "lime",
"type": "haxelib",
"version": "8.0.0"
},
{
"name": "openfl",
"type": "git",
"dir": null,
"ref": "3fd5763c1",
"url": "https://github.com/MasterEric/openfl"
},
{
"name": "polymod",
"type": "git",
"dir": null,
"ref": "547c8ee",
"url": "https://github.com/larsiusprime/polymod"
},
{
"name": "thx.semver",
"type": "haxelib",
"version": "0.2.2"
}
]
}

View file

@ -7,6 +7,7 @@ import flixel.FlxSprite;
import flixel.FlxState;
import flixel.addons.display.FlxGridOverlay;
import flixel.addons.transition.FlxTransitionableState;
import flixel.addons.ui.FlxInputText;
import flixel.group.FlxGroup.FlxTypedGroup;
import flixel.group.FlxGroup;
import flixel.group.FlxSpriteGroup;
@ -24,6 +25,7 @@ import funkin.Controls.Control;
import funkin.freeplayStuff.BGScrollingText;
import funkin.freeplayStuff.DJBoyfriend;
import funkin.freeplayStuff.FreeplayScore;
import funkin.freeplayStuff.LetterSort;
import funkin.freeplayStuff.SongMenuItem;
import funkin.play.HealthIcon;
import funkin.play.PlayState;
@ -45,6 +47,9 @@ class FreeplayState extends MusicBeatSubstate
var curDifficulty:Int = 1;
var fp:FreeplayScore;
var txtCompletion:FlxText;
var lerpCompletion:Float = 0;
var intendedCompletion:Float = 0;
var lerpScore:Float = 0;
var intendedScore:Int = 0;
@ -69,6 +74,8 @@ class FreeplayState extends MusicBeatSubstate
private var iconArray:Array<HealthIcon> = [];
var typing:FlxInputText;
override function create()
{
FlxTransitionableState.skipNextTransIn = true;
@ -229,10 +236,30 @@ class FreeplayState extends MusicBeatSubstate
fnfFreeplay.shader = sillyStroke;
add(fnfFreeplay);
fp = new FreeplayScore(420, 40, 100);
var fnfHighscoreSpr:FlxSprite = new FlxSprite(890, 70);
fnfHighscoreSpr.frames = Paths.getSparrowAtlas('freeplay/highscore');
fnfHighscoreSpr.animation.addByPrefix("highscore", "highscore", 24, false);
fnfHighscoreSpr.visible = false;
fnfHighscoreSpr.setGraphicSize(0, Std.int(fnfHighscoreSpr.height * 1));
fnfHighscoreSpr.antialiasing = true;
fnfHighscoreSpr.updateHitbox();
add(fnfHighscoreSpr);
new FlxTimer().start(FlxG.random.float(12, 50), function(tmr)
{
fnfHighscoreSpr.animation.play("highscore");
tmr.time = FlxG.random.float(20, 60);
}, 0);
fp = new FreeplayScore(460, 60, 100);
fp.visible = false;
add(fp);
txtCompletion = new FlxText(1200, 77, 0, "0", 32);
txtCompletion.font = "VCR OSD Mono";
txtCompletion.visible = false;
add(txtCompletion);
dj.onIntroDone.add(function()
{
FlxTween.tween(grpDifficulties, {x: 90}, 0.6, {ease: FlxEase.quartOut});
@ -240,11 +267,31 @@ class FreeplayState extends MusicBeatSubstate
add(new DifficultySelector(20, grpDifficulties.y - 10, false, controls));
add(new DifficultySelector(325, grpDifficulties.y - 10, true, controls));
var letterSort:LetterSort = new LetterSort(300, 100);
add(letterSort);
letterSort.changeSelectionCallback = (str) ->
{
switch (str)
{
case "fav":
generateSongList({filterType: FAVORITE}, true);
case "ALL":
generateSongList(null, true);
default:
generateSongList({filterType: STARTSWITH, filterData: str}, true);
}
};
new FlxTimer().start(1 / 24, function(handShit)
{
fnfHighscoreSpr.visible = true;
fnfFreeplay.visible = true;
fp.visible = true;
fp.updateScore(FlxG.random.int(0, 1000));
fp.updateScore(0);
txtCompletion.visible = true;
intendedCompletion = 0;
new FlxTimer().start(1.5 / 24, function(bold)
{
@ -261,55 +308,7 @@ class FreeplayState extends MusicBeatSubstate
grpTxtScrolls.visible = true;
});
for (i in 0...songs.length)
{
var funnyMenu:SongMenuItem = new SongMenuItem(FlxG.width, (i * 150) + 160, songs[i].songName);
funnyMenu.targetPos.x = funnyMenu.x;
funnyMenu.ID = i;
funnyMenu.alpha = 0.5;
funnyMenu.songText.visible = false;
fp.updateScore(0);
new FlxTimer().start((1 / 24) * i, function(doShit)
{
funnyMenu.doJumpIn = true;
});
new FlxTimer().start((0.09 * i) + 0.85, function(lerpTmr)
{
funnyMenu.doLerp = true;
});
new FlxTimer().start(((0.20 * i) / (1 + i)) + 0.75, function(swagShi)
{
funnyMenu.songText.visible = true;
funnyMenu.alpha = 1;
});
grpCapsules.add(funnyMenu);
var songText:Alphabet = new Alphabet(0, (70 * i) + 30, songs[i].songName, true, false);
songText.x += 100;
songText.isMenuItem = true;
songText.targetY = i;
// grpSongs.add(songText);
var icon:HealthIcon = new HealthIcon(songs[i].songCharacter);
// icon.sprTracker = songText;
// using a FlxGroup is too much fuss!
iconArray.push(icon);
// add(icon);
// songText.x += 40;
// DONT PUT X IN THE FIRST PARAMETER OF new ALPHABET() !!
// songText.screenCenter(X);
}
changeSelection();
changeDiff();
generateSongList();
// FlxG.sound.playMusic(Paths.music('title'), 0);
// FlxG.sound.music.fadeIn(2, 0, 0.8);
@ -340,6 +339,15 @@ class FreeplayState extends MusicBeatSubstate
funnyCam.bgColor = FlxColor.TRANSPARENT;
FlxG.cameras.add(funnyCam);
typing = new FlxInputText(100, 100);
add(typing);
typing.callback = function(txt, action)
{
// generateSongList(new EReg(txt.trim(), "ig"));
trace(action);
};
forEach(function(bs)
{
bs.cameras = [funnyCam];
@ -348,6 +356,112 @@ class FreeplayState extends MusicBeatSubstate
super.create();
}
public function generateSongList(?filterStuff:SongFilter, ?force:Bool = false)
{
curSelected = 0;
grpCapsules.clear();
// var regexp:EReg = regexp;
var tempSongs:Array<SongMetadata> = songs;
if (filterStuff != null)
{
switch (filterStuff.filterType)
{
case STARTSWITH:
tempSongs = tempSongs.filter(str ->
{
return str.songName.toLowerCase().startsWith(filterStuff.filterData);
});
case ALL:
// no filter!
case FAVORITE:
tempSongs = tempSongs.filter(str ->
{
return str.isFav;
});
default:
// return all on default
}
}
// if (regexp != null)
// tempSongs = songs.filter(item -> regexp.match(item.songName));
// tempSongs.sort(function(a, b):Int
// {
// var tempA = a.songName.toUpperCase();
// var tempB = b.songName.toUpperCase();
// if (tempA < tempB)
// return -1;
// else if (tempA > tempB)
// return 1;
// else
// return 0;
// });
for (i in 0...tempSongs.length)
{
var funnyMenu:SongMenuItem = new SongMenuItem(FlxG.width, (i * 150) + 160, tempSongs[i].songName);
funnyMenu.targetPos.x = funnyMenu.x;
funnyMenu.ID = i;
funnyMenu.alpha = 0.5;
funnyMenu.songText.visible = false;
funnyMenu.favIcon.visible = tempSongs[i].isFav;
// fp.updateScore(0);
new FlxTimer().start((1 / 24) * i, function(doShit)
{
funnyMenu.doJumpIn = true;
});
new FlxTimer().start((0.09 * i) + 0.85, function(lerpTmr)
{
funnyMenu.doLerp = true;
});
if (!force)
{
new FlxTimer().start(((0.20 * i) / (1 + i)) + 0.75, function(swagShi)
{
funnyMenu.songText.visible = true;
funnyMenu.alpha = 1;
});
}
else
{
funnyMenu.songText.visible = true;
funnyMenu.alpha = 1;
}
grpCapsules.add(funnyMenu);
var songText:Alphabet = new Alphabet(0, (70 * i) + 30, tempSongs[i].songName, true, false);
songText.x += 100;
songText.isMenuItem = true;
songText.targetY = i;
// grpSongs.add(songText);
var icon:HealthIcon = new HealthIcon(tempSongs[i].songCharacter);
// icon.sprTracker = songText;
// using a FlxGroup is too much fuss!
iconArray.push(icon);
// add(icon);
// songText.x += 40;
// DONT PUT X IN THE FIRST PARAMETER OF new ALPHABET() !!
// songText.screenCenter(X);
}
changeSelection();
changeDiff();
}
public function addSong(songName:String, weekNum:Int, songCharacter:String)
{
songs.push(new SongMetadata(songName, weekNum, songCharacter));
@ -379,10 +493,45 @@ class FreeplayState extends MusicBeatSubstate
var initTouchPos:FlxPoint = new FlxPoint();
var spamTimer:Float = 0;
var spamming:Bool = false;
override function update(elapsed:Float)
{
super.update(elapsed);
if (FlxG.keys.justPressed.F)
{
var realShit = curSelected;
songs[curSelected].isFav = !songs[curSelected].isFav;
if (songs[curSelected].isFav)
{
FlxTween.tween(grpCapsules.members[realShit], {angle: 360}, 0.4, {
ease: FlxEase.elasticOut,
onComplete: _ ->
{
grpCapsules.members[realShit].favIcon.visible = true;
grpCapsules.members[realShit].favIcon.animation.play("fav");
}
});
}
else
{
grpCapsules.members[realShit].favIcon.animation.play('fav', false, true);
new FlxTimer().start((1 / 24) * 14, _ ->
{
grpCapsules.members[realShit].favIcon.visible = false;
});
new FlxTimer().start((1 / 24) * 24, _ ->
{
FlxTween.tween(grpCapsules.members[realShit], {angle: 0}, 0.4, {ease: FlxEase.elasticOut});
});
}
}
if (FlxG.keys.justPressed.T)
typing.hasFocus = true;
if (FlxG.sound.music != null)
{
if (FlxG.sound.music.volume < 0.7)
@ -392,8 +541,16 @@ class FreeplayState extends MusicBeatSubstate
}
lerpScore = CoolUtil.coolLerp(lerpScore, intendedScore, 0.2);
lerpCompletion = CoolUtil.coolLerp(lerpCompletion, intendedCompletion, 0.9);
fp.scoreShit = Std.int(lerpScore);
fp.updateScore(Std.int(lerpScore));
txtCompletion.text = Math.floor(lerpCompletion * 100) + "%";
trace(Highscore.getCompletion(songs[curSelected].songName, curDifficulty));
// trace(intendedScore);
// trace(lerpScore);
// Highscore.getAllScores();
var upP = controls.UI_UP_P;
var downP = controls.UI_DOWN_P;
@ -484,6 +641,31 @@ class FreeplayState extends MusicBeatSubstate
}
#end
if (controls.UI_UP || controls.UI_DOWN)
{
spamTimer += elapsed;
if (spamming)
{
if (spamTimer >= 0.07)
{
spamTimer = 0;
if (controls.UI_UP)
changeSelection(-1);
else
changeSelection(1);
}
}
else if (spamTimer >= 0.9)
spamming = true;
}
else
{
spamming = false;
spamTimer = 0;
}
if (upP)
{
dj.resetAFKTimer();
@ -512,7 +694,7 @@ class FreeplayState extends MusicBeatSubstate
changeDiff(1);
}
if (controls.BACK)
if (controls.BACK && !typing.hasFocus)
{
FlxG.sound.play(Paths.sound('cancelMenu'));
@ -588,6 +770,7 @@ class FreeplayState extends MusicBeatSubstate
// intendedScore = Highscore.getScore(songs[curSelected].songName, curDifficulty);
intendedScore = Highscore.getScore(songs[curSelected].songName, curDifficulty);
intendedCompletion = Highscore.getCompletion(songs[curSelected].songName, curDifficulty);
PlayState.storyDifficulty = curDifficulty;
PlayState.storyDifficulty_NEW = switch (curDifficulty)
@ -644,14 +827,15 @@ class FreeplayState extends MusicBeatSubstate
curSelected += change;
if (curSelected < 0)
curSelected = songs.length - 1;
if (curSelected >= songs.length)
curSelected = grpCapsules.members.length - 1;
if (curSelected >= grpCapsules.members.length)
curSelected = 0;
// selector.y = (70 * curSelected) + 30;
// intendedScore = Highscore.getScore(songs[curSelected].songName, curDifficulty);
intendedScore = FlxG.random.int(0, 1000000);
intendedScore = Highscore.getScore(songs[curSelected].songName, curDifficulty);
intendedCompletion = Highscore.getCompletion(songs[curSelected].songName, curDifficulty);
// lerpScore = 0;
#if PRELOAD_ALL
@ -679,7 +863,8 @@ class FreeplayState extends MusicBeatSubstate
capsule.targetPos.y -= 100; // another 100 for good measure
}
grpCapsules.members[curSelected].selected = true;
if (grpCapsules.members.length > 0)
grpCapsules.members[curSelected].selected = true;
}
}
@ -729,16 +914,31 @@ class DifficultySelector extends FlxSprite
}
}
typedef SongFilter =
{
var filterType:FilterType;
var ?filterData:Dynamic;
}
enum abstract FilterType(String)
{
var STARTSWITH;
var FAVORITE;
var ALL;
}
class SongMetadata
{
public var songName:String = "";
public var week:Int = 0;
public var songCharacter:String = "";
public var isFav:Bool = false;
public function new(song:String, week:Int, songCharacter:String)
public function new(song:String, week:Int, songCharacter:String, ?isFav:Bool = false)
{
this.songName = song;
this.week = week;
this.songCharacter = songCharacter;
this.isFav = isFav;
}
}

View file

@ -8,6 +8,12 @@ class Highscore
public static var songScores:Map<String, Int> = new Map<String, Int>();
#end
#if (haxe >= "4.0.0")
public static var songCompletion:Map<String, Float> = new Map();
#else
public static var songCompletion:Map<String, Float> = new Map<String, Float>();
#end
public static var tallies:Tallies = new Tallies();
public static function saveScore(song:String, score:Int = 0, ?diff:Int = 0):Bool
@ -33,6 +39,24 @@ class Highscore
return false;
}
public static function saveCompletion(song:String, completion:Float, ?diff:Int = 0):Bool
{
var formattedSong:String = formatSong(song, diff);
if (songCompletion.exists(formattedSong))
{
if (songCompletion.get(formattedSong) < completion)
{
setCompletion(formattedSong, completion);
return true;
}
}
else
setCompletion(formattedSong, completion);
return false;
}
public static function saveWeekScore(week:Int = 1, score:Int = 0, ?diff:Int = 0):Void
{
#if newgrounds
@ -50,6 +74,13 @@ class Highscore
setScore(formattedSong, score);
}
static function setCompletion(formattedSong:String, completion:Float):Void
{
songCompletion.set(formattedSong, completion);
FlxG.save.data.songCompletion = songCompletion;
FlxG.save.flush();
}
/**
* YOU SHOULD FORMAT SONG WITH formatSong() BEFORE TOSSING IN SONG VARIABLE
*/
@ -88,6 +119,19 @@ class Highscore
return songScores.get(formatSong(song, diff));
}
public static function getCompletion(song, diff):Float
{
if (!songCompletion.exists(formatSong(song, diff)))
setCompletion(formatSong(song, diff), 0);
return songCompletion.get(formatSong(song, diff));
}
public static function getAllScores()
{
trace(songScores.toString());
}
public static function getWeekScore(week:Int, diff:Int):Int
{
if (!songScores.exists(formatSong('week' + week, diff)))
@ -102,6 +146,9 @@ class Highscore
{
songScores = FlxG.save.data.songScores;
}
if (FlxG.save.data.songCompletion != null)
songCompletion = FlxG.save.data.songCompletion;
}
}
@ -120,6 +167,7 @@ abstract Tallies(RawTallies)
good: 0,
sick: 0,
totalNotes: 0,
totalNotesHit: 0,
maxCombo: 0,
isNewHighscore: false
}
@ -145,5 +193,10 @@ typedef RawTallies =
/**
* How many notes total that you hit. (NOT how many notes total in the song!)
*/
var totalNotesHit:Int;
/**
* How many notes PASSED BY AND/OR HIT!!!
*/
var totalNotes:Int;
}

View file

@ -81,6 +81,9 @@ class PauseSubState extends MusicBeatSubstate
var deathCounter:FlxText = new FlxText(20, 15 + 64, 0, "", 32);
deathCounter.text = "Blue balled: " + PlayState.deathCounter;
deathCounter.text += "\n" + Highscore.tallies.totalNotesHit;
deathCounter.text += "\n" + Highscore.tallies.totalNotes;
deathCounter.text += "\n" + Std.string(Highscore.tallies.totalNotesHit / Highscore.tallies.totalNotes);
deathCounter.scrollFactor.set();
deathCounter.setFormat(Paths.font('vcr.ttf'), 32);
deathCounter.updateHitbox();

View file

@ -69,13 +69,15 @@ class ScoreNum extends FlxSprite
function set_digit(val):Int
{
if (animation.curAnim != null && animation.curAnim.name != Std.string(val))
if (animation.curAnim != null && animation.curAnim.name != numToString[val])
{
animation.play(Std.string(val), true, false, 0);
animation.play(numToString[val], true, false, 0);
updateHitbox();
switch (val)
{
case 1:
offset.x -= 15;
case 5:
// set offsets
// offset.x += 0;
@ -98,6 +100,8 @@ class ScoreNum extends FlxSprite
public var baseY:Float = 0;
public var baseX:Float = 0;
var numToString:Array<String> = ["ZERO", "ONE", "TWO", "THREE", "FOUR", "FIVE", "SIX", "SEVEN", "EIGHT", "NINE"];
public function new(x:Float, y:Float, ?initDigit:Int = 0)
{
super(x, y);
@ -105,20 +109,20 @@ class ScoreNum extends FlxSprite
baseY = y;
baseX = x;
frames = Paths.getSparrowAtlas('noteComboNumbers');
frames = Paths.getSparrowAtlas('digital_numbers');
for (i in 0...10)
{
var stringNum:String = Std.string(i);
var stringNum:String = numToString[i];
animation.addByPrefix(stringNum, stringNum, 24, false);
}
this.digit = initDigit;
animation.play(Std.string(digit), true);
animation.play(numToString[digit], true);
antialiasing = true;
setGraphicSize(Std.int(width * 0.3));
setGraphicSize(Std.int(width * 0.4));
updateHitbox();
}
}

View file

@ -0,0 +1,106 @@
package funkin.freeplayStuff;
import flixel.FlxSprite;
import flixel.group.FlxGroup.FlxTypedGroup;
import flixel.group.FlxGroup;
import flixel.group.FlxSpriteGroup.FlxTypedSpriteGroup;
class LetterSort extends FlxTypedSpriteGroup<FreeplayLetter>
{
public var letters:Array<FreeplayLetter> = [];
var curSelection:Int = 0;
public var changeSelectionCallback:String->Void;
public function new(x, y)
{
super(x, y);
var leftArrow:FreeplayLetter = new FreeplayLetter(-20, 0);
leftArrow.animation.play("arrow");
add(leftArrow);
for (i in 0...6)
{
var letter:FreeplayLetter = new FreeplayLetter(i * 80, 0, i);
add(letter);
letters.push(letter);
if (i == 3)
letter.alpha = 0.6;
var sep:FreeplayLetter = new FreeplayLetter((i * 80) + 50, 0);
sep.animation.play("seperator");
add(sep);
}
// changeSelection(-3);
}
override function update(elapsed:Float)
{
super.update(elapsed);
if (FlxG.keys.justPressed.E)
changeSelection(1);
if (FlxG.keys.justPressed.Q)
changeSelection(-1);
}
public function changeSelection(diff:Int = 0)
{
for (letter in letters)
letter.changeLetter(diff);
if (changeSelectionCallback != null)
changeSelectionCallback(letters[3].arr[letters[3].curLetter]); // bullshit and long lol!
}
}
class FreeplayLetter extends FlxSprite
{
public var arr:Array<String> = [];
public var curLetter:Int = 0;
public function new(x:Float, y:Float, ?letterInd:Int)
{
super(x, y);
frames = Paths.getSparrowAtlas("freeplay/letterStuff");
var alphabet:String = "abcdefghijklmnopqrstuvwxyz";
arr = alphabet.split("");
arr.insert(0, "#");
arr.insert(0, "ALL");
arr.insert(0, "fav");
for (str in arr)
{
animation.addByPrefix(str, str + " "); // string followed by a space! intentional!
}
animation.addByPrefix("arrow", "mini arrow");
animation.addByPrefix("seperator", "seperator");
if (letterInd != null)
{
animation.play(arr[letterInd]);
curLetter = letterInd;
}
}
public function changeLetter(diff:Int = 0)
{
curLetter += diff;
if (curLetter < 0)
curLetter = arr.length - 1;
if (curLetter >= arr.length)
curLetter = 0;
animation.play(arr[curLetter]);
}
}

View file

@ -17,6 +17,7 @@ class SongMenuItem extends FlxSpriteGroup
public var songTitle:String = "Test";
public var songText:FlxText;
public var favIcon:FlxSprite;
public var targetPos:FlxPoint = new FlxPoint();
public var doLerp:Bool = false;
@ -40,6 +41,14 @@ class SongMenuItem extends FlxSpriteGroup
songText.color = 0xFF43C1EA;
add(songText);
favIcon = new FlxSprite(440, 40);
favIcon.frames = Paths.getSparrowAtlas('freeplay/favHeart');
favIcon.animation.addByPrefix('fav', "favorite heart", 24, false);
favIcon.animation.play('fav');
favIcon.antialiasing = true;
favIcon.setGraphicSize(60, 60);
add(favIcon);
selected = selected; // just to kickstart the set_selected
}

View file

@ -1197,6 +1197,9 @@ class PlayState extends MusicBeatState
function regenNoteData_NEW():Void
{
Highscore.tallies.combo = 0;
Highscore.tallies = new Tallies();
// Reset song events.
songEvents = currentChart.getEvents();
SongEventHandler.resetEvents(songEvents);
@ -1638,6 +1641,10 @@ class PlayState extends MusicBeatState
while (inactiveNotes[0] != null && inactiveNotes[0].data.strumTime - Conductor.songPosition < 1800 / SongLoad.getSpeed())
{
var dunceNote:Note = inactiveNotes[0];
if (dunceNote.mustPress && !dunceNote.isSustainNote)
Highscore.tallies.totalNotes++;
activeNotes.add(dunceNote);
inactiveNotes.shift();
@ -1847,6 +1854,8 @@ class PlayState extends MusicBeatState
{
// crackhead double thingie, sets whether was new highscore, AND saves the song!
Highscore.tallies.isNewHighscore = Highscore.saveScore(currentSong.song, songScore, storyDifficulty);
Highscore.saveCompletion(currentSong.song, Highscore.tallies.totalNotesHit / Highscore.tallies.totalNotes, storyDifficulty);
}
if (isStoryMode)
@ -2274,7 +2283,7 @@ class PlayState extends MusicBeatState
if (!note.isSustainNote)
{
Highscore.tallies.combo++;
Highscore.tallies.totalNotes++;
Highscore.tallies.totalNotesHit++;
if (Highscore.tallies.combo > Highscore.tallies.maxCombo)
Highscore.tallies.maxCombo = Highscore.tallies.combo;

View file

@ -28,7 +28,7 @@ class ResultState extends MusicBeatSubstate
override function create()
{
if (Highscore.tallies.sick == Highscore.tallies.totalNotes && Highscore.tallies.maxCombo == Highscore.tallies.totalNotes)
if (Highscore.tallies.sick == Highscore.tallies.totalNotesHit && Highscore.tallies.maxCombo == Highscore.tallies.totalNotesHit)
resultsVariation = PERFECT;
else if (Highscore.tallies.missed + Highscore.tallies.bad + Highscore.tallies.shit >= Highscore.tallies.totalNotes * 0.50)
resultsVariation = SHIT; // if more than half of your song was missed, bad, or shit notes, you get shit ending!
@ -165,7 +165,7 @@ class ResultState extends MusicBeatSubstate
var ratingGrp:FlxTypedGroup<TallyCounter> = new FlxTypedGroup<TallyCounter>();
add(ratingGrp);
var totalHit:TallyCounter = new TallyCounter(375, hStuf * 3, Highscore.tallies.totalNotes);
var totalHit:TallyCounter = new TallyCounter(375, hStuf * 3, Highscore.tallies.totalNotesHit);
ratingGrp.add(totalHit);
var maxCombo:TallyCounter = new TallyCounter(375, hStuf * 4, Highscore.tallies.maxCombo);