Skip to content

Commit

Permalink
fix up some stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
ThatRozebudDude committed Aug 10, 2024
1 parent 88b22fc commit 3cc1854
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 13 deletions.
15 changes: 5 additions & 10 deletions source/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -1402,10 +1402,8 @@ class PlayState extends MusicBeatState

if (health <= 0){ openGameOver(); }

if (unspawnNotes[0] != null)
{
if (unspawnNotes[0].strumTime - Conductor.songPosition < 3000)
{
if (unspawnNotes[0] != null){
if (unspawnNotes[0].strumTime - Conductor.songPosition < 3000){
var dunceNote:Note = unspawnNotes[0];
notes.add(dunceNote);

Expand Down Expand Up @@ -1491,8 +1489,7 @@ class PlayState extends MusicBeatState
daNote.y += 125;

if ((!daNote.mustPress || daNote.wasGoodHit || daNote.prevNote.wasGoodHit && !daNote.canBeHit)
&& daNote.y - daNote.offset.y * daNote.scale.y + daNote.height >= (strumLine.y + Note.swagWidth / 2))
{
&& daNote.y - daNote.offset.y * daNote.scale.y + daNote.height >= (strumLine.y + Note.swagWidth / 2)){
// Clip to strumline
var swagRect = new FlxRect(0, 0, daNote.frameWidth * 2, daNote.frameHeight * 2);
swagRect.height = (targetY + Note.swagWidth / 2 - daNote.y) / daNote.scale.y;
Expand All @@ -1506,8 +1503,7 @@ class PlayState extends MusicBeatState
daNote.y = (strumLine.y - (Conductor.songPosition - daNote.strumTime) * (0.45 * scrollSpeed)) + daNote.yOffset;
if(daNote.isSustainNote){
if ((!daNote.mustPress || daNote.wasGoodHit || daNote.prevNote.wasGoodHit && !daNote.canBeHit)
&& daNote.y + daNote.offset.y * daNote.scale.y <= (strumLine.y + Note.swagWidth / 2))
{
&& daNote.y + daNote.offset.y * daNote.scale.y <= (strumLine.y + Note.swagWidth / 2)){
// Clip to strumline
var swagRect = new FlxRect(0, 0, daNote.width / daNote.scale.x, daNote.height / daNote.scale.y);
swagRect.y = (targetY + Note.swagWidth / 2 - daNote.y) / daNote.scale.y;
Expand All @@ -1528,8 +1524,7 @@ class PlayState extends MusicBeatState
}
}

if (Config.downscroll ? (daNote.y > strumLine.y + daNote.height + 50) : (daNote.y < strumLine.y - daNote.height - 50))
{
if (Config.downscroll ? (daNote.y > strumLine.y + daNote.height + 50) : (daNote.y < strumLine.y - daNote.height - 50)){
if (daNote.tooLate || daNote.wasGoodHit){

daNote.active = false;
Expand Down
10 changes: 10 additions & 0 deletions source/Utils.hx
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,16 @@ class Utils
return point.set(sprite.x + sprite.frameWidth * 0.5, sprite.y + sprite.frameHeight * 0.5);
}

//Actually center offsets.
public static inline function centerOffsets(sprite:FlxSprite, AdjustPosition:Bool = false):Void{
sprite.offset.x = ((sprite.frameWidth * sprite.scale.x) - sprite.width) * 0.5;
sprite.offset.y = ((sprite.frameHeight * sprite.scale.y) - sprite.height) * 0.5;
if (AdjustPosition){
sprite.x += sprite.offset.x;
sprite.y += sprite.offset.y;
}
}

/*
* Adjusts the value based on the reference FPS.
*/
Expand Down
2 changes: 1 addition & 1 deletion source/characters/data/PicoDead.hx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class PicoDead extends CharacterInfoBase
addByIndices('deathConfirm', offset(225, 125), "Pico Death Stab", [48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63], "", 24, loop(true));

info.functions.create = deathCreate;
info.functions.add = deathAdd;
info.functions.deathAdd = deathAdd;
info.functions.frame = frame;
info.functions.playAnim = playAnim;

Expand Down
4 changes: 2 additions & 2 deletions source/stages/data/PhillyBlazin.hx
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,11 @@ class PhillyBlazin extends BaseStage

streetBlurMultiply.visible = true;
streetBlurMultiply.alpha = 0.8;
FlxTween.tween(streetBlurMultiply, {alpha: 0.0}, LIGHTNING_FULL_DURATION, {startDelay: LIGHTNING_HOLD_DURATION});
tween.tween(streetBlurMultiply, {alpha: 0.0}, LIGHTNING_FULL_DURATION, {startDelay: LIGHTNING_HOLD_DURATION});

additionalLighten.visible = true;
additionalLighten.alpha = 0.5;
FlxTween.tween(additionalLighten, {alpha: 0.0}, LIGHTNING_FADE_DURATION, {startDelay: LIGHTNING_HOLD_DURATION});
tween.tween(additionalLighten, {alpha: 0.0}, LIGHTNING_FADE_DURATION, {startDelay: LIGHTNING_HOLD_DURATION});

lightning.visible = true;
lightning.animation.play('strike');
Expand Down

0 comments on commit 3cc1854

Please sign in to comment.