Skip to content

Commit

Permalink
added simply combo option
Browse files Browse the repository at this point in the history
  • Loading branch information
pixloen committed Sep 27, 2021
1 parent d53d566 commit a3a1f78
Show file tree
Hide file tree
Showing 5 changed files with 94 additions and 26 deletions.
Binary file modified assets/images/UI/simplylove/base/combo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 7 additions & 4 deletions source/ForeverAssets.hx
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,19 @@ class ForeverAssets
newSprite.animation.play('base');
}

if (assetModifier == 'pixel')
if (assetModifier == 'pixel')
newSprite.setGraphicSize(Std.int(newSprite.width * PlayState.daPixelZoom));
else
{
newSprite.antialiasing = true;
newSprite.setGraphicSize(Std.int(newSprite.width * 0.5));
}
newSprite.updateHitbox();

if (!Init.trueSettings.get('Simply Judgements'))
{
newSprite.acceleration.y = FlxG.random.int(200, 300);
newSprite.velocity.y = -FlxG.random.int(140, 160);
newSprite.velocity.x = FlxG.random.float(-5, 5);
newSprite.velocity.x = FlxG.random.float(-5, 5);}

return newSprite;
}
Expand All @@ -88,10 +89,12 @@ class ForeverAssets
rating.screenCenter();
rating.x = (FlxG.width * 0.55) - 40;
rating.y -= 60;
if (!Init.trueSettings.get('Simply Judgements'))
{
rating.acceleration.y = 550;
rating.velocity.y = -FlxG.random.int(140, 175);
rating.velocity.x = -FlxG.random.int(0, 10);

}
rating.animation.add('base', [
Std.int((Timings.judgementsMap.get(asset)[0] * 2) + (perfectSick ? 0 : 2) + (timing == 'late' ? 1 : 0))
], 24, false);
Expand Down
6 changes: 6 additions & 0 deletions source/Init.hx
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,12 @@ class Init extends FlxState
Checkmark,
"Fixes the judgements to the camera instead of to the world itself, making them easier to read."
],
'Simply Judgements' => [
false,
Checkmark,
"Simplifies the judgement animations, displaying only one judgement / rating sprite at a time."
],


];

Expand Down
102 changes: 80 additions & 22 deletions source/gameFolder/meta/state/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,11 @@ class PlayState extends MusicBeatState

private var allUIs:Array<FlxCamera> = [];

// stores the last judgement object
public static var lastRating:FlxSprite;
// stores the last combo objects in an array
public static var lastCombo:Array<FlxSprite>;

// at the beginning of the playstate
override public function create()
{
Expand All @@ -150,6 +155,8 @@ class PlayState extends MusicBeatState
combo = 0;
health = 1;
misses = 0;
// sets up the combo object array
lastCombo = [];

defaultCamZoom = 1.05;
forceZoom = [0, 0, 0, 0];
Expand Down Expand Up @@ -1093,30 +1100,60 @@ class PlayState extends MusicBeatState
if ((comboString.startsWith('-')) || (combo == 0))
negative = true;
var stringArray:Array<String> = comboString.split("");
// deletes all combo sprites prior to initalizing new ones
if (lastCombo != null)
{
for (i in 0...lastCombo.length - 1)
{
lastCombo[i].kill();
lastCombo.remove(lastCombo[i]);
}
if (lastCombo.length == 1)
{
//this part is very jank, but it works
lastCombo[0].kill();
lastCombo.remove(lastCombo[0]);
}
}

for (scoreInt in 0...stringArray.length)
{
// numScore.loadGraphic(Paths.image('UI/' + pixelModifier + 'num' + stringArray[scoreInt]));
var numScore = ForeverAssets.generateCombo('combo', stringArray[scoreInt], (!negative ? allSicks : false), assetModifier, changeableSkin, 'UI',
negative, createdColor, scoreInt);
add(numScore);
// hardcoded lmao
if (!Init.trueSettings.get('Simply Judgements'))
{
add(numScore);
FlxTween.tween(numScore, {alpha: 0}, 0.2, {
onComplete: function(tween:FlxTween)
{
numScore.kill();
},
startDelay: Conductor.crochet * 0.002
});
}
else
{
add(numScore);
// centers combo
numScore.y += 10;
numScore.x -= 95;
numScore.x -= ((comboString.length - 1) * 22);
lastCombo.push(numScore);
FlxTween.tween(numScore, {y: numScore.y + 20}, 0.1, {type: FlxTween.BACKWARD, ease: FlxEase.circOut});
}
if (preload)
numScore.visible = false;
// hardcoded lmao
if (Init.trueSettings.get('Fixed Judgements'))
{
numScore.cameras = [camHUD];
numScore.x += 100;
numScore.y += 50;
}

if (preload)
numScore.visible = false;

FlxTween.tween(numScore, {alpha: 0}, 0.2, {
onComplete: function(tween:FlxTween)
{
numScore.kill();
},
startDelay: Conductor.crochet * 0.002
});
} else
numScore.x += 100;
}
}

Expand Down Expand Up @@ -1173,6 +1210,37 @@ class PlayState extends MusicBeatState
var rating = ForeverAssets.generateRating('$daRating', (daRating == 'sick' ? allSicks : false), timing, assetModifier, changeableSkin, 'UI');
add(rating);

if (!Init.trueSettings.get('Simply Judgements'))
{
add(rating);

FlxTween.tween(rating, {alpha: 0}, 0.2, {
onComplete: function(tween:FlxTween)
{
rating.kill();
},
startDelay: Conductor.crochet * 0.00125
});
}
else
{
if (lastRating != null)
{
lastRating.kill();
}
add(rating);
lastRating = rating;
FlxTween.tween(rating, {y: rating.y + 20}, 0.2, {type: FlxTweenType.BACKWARD, ease: FlxEase.circOut});
FlxTween.tween(rating, {"scale.x": 0, "scale.y": 0}, 0.1, {
onComplete: function(tween:FlxTween)
{
rating.kill();
},
startDelay: Conductor.crochet * 0.00125
});
}
// */

if (Init.trueSettings.get('Fixed Judgements'))
{
// bound to camera
Expand All @@ -1182,16 +1250,6 @@ class PlayState extends MusicBeatState

if (cache)
rating.visible = false;

///*
FlxTween.tween(rating, {alpha: 0}, 0.2, {
onComplete: function(tween:FlxTween)
{
rating.kill();
},
startDelay: Conductor.crochet * 0.00125
});
// */
}

function healthCall(?ratingMultiplier:Float = 0)
Expand Down
1 change: 1 addition & 0 deletions source/gameFolder/meta/state/menus/OptionsMenuState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ class OptionsMenuState extends MusicBeatState
['Disable Antialiasing', getFromOption],
['No Camera Note Movement', getFromOption],
['Fixed Judgements', getFromOption],
['Simply Judgements', getFromOption],
['', null],
['Accessibility Settings', null],
['', null],
Expand Down

0 comments on commit a3a1f78

Please sign in to comment.