1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2024-11-23 15:26:06 +00:00

cool note thingies

This commit is contained in:
Cameron Taylor 2021-03-26 03:51:39 -04:00
parent 85e181bc80
commit 45652399c3
3 changed files with 62 additions and 2 deletions

38
source/NoteSplash.hx Normal file
View file

@ -0,0 +1,38 @@
package;
import flixel.FlxG;
import flixel.FlxSprite;
import haxe.io.Path;
class NoteSplash extends FlxSprite
{
public function new(x:Float, y:Float, noteData:Int = 0):Void
{
super(x, y);
frames = Paths.getSparrowAtlas('noteSplashes');
animation.addByPrefix('note1-0', 'note impact 1 blue', 24, false);
animation.addByPrefix('note2-0', 'note impact 1 green', 24, false);
animation.addByPrefix('note0-0', 'note impact 1 purple', 24, false);
animation.addByPrefix('note3-0', 'note impact 1 red', 24, false);
animation.addByPrefix('note1-1', 'note impact 2 blue', 24, false);
animation.addByPrefix('note2-1', 'note impact 2 green', 24, false);
animation.addByPrefix('note0-1', 'note impact 2 purple', 24, false);
animation.addByPrefix('note3-1', 'note impact 2 red', 24, false);
animation.play('note' + noteData + '-' + FlxG.random.int(0, 1));
animation.curAnim.frameRate += FlxG.random.int(-2, 2);
updateHitbox();
offset.set(width * 0.3, height * 0.3);
}
override function update(elapsed:Float)
{
if (animation.curAnim.finished)
kill();
super.update(elapsed);
}
}

View file

@ -1792,7 +1792,7 @@ class PlayState extends MusicBeatState
var endingSong:Bool = false;
private function popUpScore(strumtime:Float):Void
private function popUpScore(strumtime:Float, daNote:Note):Void
{
var noteDiff:Float = Math.abs(strumtime - Conductor.songPosition);
// boyfriend.playAnim('hey');
@ -1810,20 +1810,33 @@ class PlayState extends MusicBeatState
var daRating:String = "sick";
var isSick:Bool = true;
if (noteDiff > Conductor.safeZoneOffset * 0.9)
{
daRating = 'shit';
score = 50;
isSick = false; // shitty copypaste on this literally just because im lazy and tired lol!
}
else if (noteDiff > Conductor.safeZoneOffset * 0.75)
{
daRating = 'bad';
score = 100;
isSick = false;
}
else if (noteDiff > Conductor.safeZoneOffset * 0.2)
{
daRating = 'good';
score = 200;
isSick = false;
}
if (isSick)
{
var noteSplash:NoteSplash = new NoteSplash(daNote.x, daNote.y, daNote.noteData);
add(noteSplash);
noteSplash.cameras = [camHUD];
}
songScore += score;
@ -2272,7 +2285,7 @@ class PlayState extends MusicBeatState
{
if (!note.isSustainNote)
{
popUpScore(note.strumTime);
popUpScore(note.strumTime, note);
combo += 1;
}

View file

@ -0,0 +1,9 @@
package ui;
class SettingsMenu extends ui.OptionsState.Page
{
public function new()
{
super();
}
}