cool note thingies

This commit is contained in:
Cameron Taylor 2021-03-26 03:51:39 -04:00
parent f98cb76c98
commit 4247f82694
7 changed files with 99 additions and 2 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 740 KiB

View File

@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<TextureAtlas imagePath="noteSplashes.png">
<!-- Created with Adobe Animate version 21.0.0.35450 -->
<!-- http://www.adobe.com/products/animate.html -->
<SubTexture name="note impact 1 blue0000" x="1850" y="262" width="189" height="270" frameX="-32" frameY="-12" frameWidth="260" frameHeight="298"/>
<SubTexture name="note impact 1 blue0001" x="1540" y="556" width="213" height="265" frameX="-27" frameY="-22" frameWidth="260" frameHeight="298"/>
<SubTexture name="note impact 1 blue0002" x="1056" y="0" width="252" height="291" frameX="-4" frameY="-6" frameWidth="260" frameHeight="298"/>
<SubTexture name="note impact 1 blue0003" x="0" y="0" width="260" height="298"/>
<SubTexture name="note impact 1 green0000" x="663" y="806" width="189" height="270" frameX="-32" frameY="-12" frameWidth="260" frameHeight="298"/>
<SubTexture name="note impact 1 green0001" x="1757" y="556" width="213" height="265" frameX="-27" frameY="-22" frameWidth="260" frameHeight="298"/>
<SubTexture name="note impact 1 green0002" x="1312" y="0" width="252" height="291" frameX="-4" frameY="-6" frameWidth="260" frameHeight="298"/>
<SubTexture name="note impact 1 green0003" x="264" y="0" width="260" height="298"/>
<SubTexture name="note impact 1 purple0000" x="1121" y="818" width="189" height="270" frameX="-32" frameY="-12" frameWidth="260" frameHeight="298"/>
<SubTexture name="note impact 1 purple0001" x="0" y="563" width="213" height="265" frameX="-27" frameY="-22" frameWidth="260" frameHeight="298"/>
<SubTexture name="note impact 1 purple0002" x="1568" y="0" width="252" height="291" frameX="-4" frameY="-6" frameWidth="260" frameHeight="298"/>
<SubTexture name="note impact 1 purple0003" x="528" y="0" width="260" height="298"/>
<SubTexture name="note impact 1 red0000" x="1314" y="818" width="189" height="270" frameX="-32" frameY="-12" frameWidth="260" frameHeight="298"/>
<SubTexture name="note impact 1 red0001" x="217" y="563" width="213" height="265" frameX="-27" frameY="-22" frameWidth="260" frameHeight="298"/>
<SubTexture name="note impact 1 red0002" x="1056" y="295" width="252" height="291" frameX="-4" frameY="-6" frameWidth="260" frameHeight="298"/>
<SubTexture name="note impact 1 red0003" x="792" y="0" width="260" height="298"/>
<SubTexture name="note impact 2 blue0000" x="1121" y="590" width="169" height="201" frameX="-45" frameY="-41" frameWidth="274" frameHeight="267"/>
<SubTexture name="note impact 2 blue0001" x="434" y="564" width="225" height="238" frameX="-20" frameY="-19" frameWidth="274" frameHeight="267"/>
<SubTexture name="note impact 2 blue0002" x="1312" y="295" width="265" height="257" frameX="0" frameY="-10" frameWidth="274" frameHeight="267"/>
<SubTexture name="note impact 2 blue0003" x="1824" y="0" width="224" height="258" frameX="-50" frameY="0" frameWidth="274" frameHeight="267"/>
<SubTexture name="note impact 2 green0000" x="1507" y="825" width="169" height="201" frameX="-45" frameY="-41" frameWidth="274" frameHeight="267"/>
<SubTexture name="note impact 2 green0001" x="663" y="564" width="225" height="238" frameX="-20" frameY="-19" frameWidth="274" frameHeight="267"/>
<SubTexture name="note impact 2 green0002" x="1581" y="295" width="265" height="257" frameX="0" frameY="-10" frameWidth="274" frameHeight="267"/>
<SubTexture name="note impact 2 green0003" x="538" y="302" width="224" height="258" frameX="-50" frameY="0" frameWidth="274" frameHeight="267"/>
<SubTexture name="note impact 2 purple0000" x="1680" y="825" width="169" height="201" frameX="-45" frameY="-41" frameWidth="274" frameHeight="267"/>
<SubTexture name="note impact 2 purple0001" x="892" y="590" width="225" height="238" frameX="-20" frameY="-19" frameWidth="274" frameHeight="267"/>
<SubTexture name="note impact 2 purple0002" x="0" y="302" width="265" height="257" frameX="0" frameY="-10" frameWidth="274" frameHeight="267"/>
<SubTexture name="note impact 2 purple0003" x="766" y="302" width="224" height="258" frameX="-50" frameY="0" frameWidth="274" frameHeight="267"/>
<SubTexture name="note impact 2 red0000" x="1853" y="825" width="169" height="201" frameX="-45" frameY="-41" frameWidth="274" frameHeight="267"/>
<SubTexture name="note impact 2 red0001" x="434" y="806" width="225" height="238" frameX="-20" frameY="-19" frameWidth="274" frameHeight="267"/>
<SubTexture name="note impact 2 red0002" x="269" y="302" width="265" height="257" frameX="0" frameY="-10" frameWidth="274" frameHeight="267"/>
<SubTexture name="note impact 2 red0003" x="1312" y="556" width="224" height="258" frameX="-50" frameY="0" frameWidth="274" frameHeight="267"/>
</TextureAtlas>

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();
}
}