Skip to content

Commit

Permalink
sum engine touch ups :]
Browse files Browse the repository at this point in the history
  • Loading branch information
AnimatingLegend committed Jun 6, 2024
1 parent 5656bf6 commit 44b9b75
Show file tree
Hide file tree
Showing 12 changed files with 300 additions and 291 deletions.
4 changes: 4 additions & 0 deletions assets/preload/data/roses/rosesDialogueCensored.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
:dad:Not bad for an ugly worm.
:dad:But this time I'm gonna make you scream...
:dad:Almost as loud as I'll make your girlfriend scream later tonight, you fat midget.
:bf:Bop beep be be skdoo bep
2 changes: 1 addition & 1 deletion assets/preload/data/test/test-easy.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/preload/data/test/test-hard.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/preload/data/test/test.json

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions assets/shared/images/charactersAssets/bfPixelsDEAD.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<TextureAtlas imagePath="bfPixelsDEAD.png">
<!-- Created with Adobe Animate version 20.0.0.17400 -->
<!-- http://www.adobe.com/products/animate.html -->

<!-- manual tweaks done on BF Dies pixel last 2 frames -->
<SubTexture name="BF Dies pixel0000" x="0" y="0" width="90" height="81"/>
<SubTexture name="BF Dies pixel0001" x="100" y="0" width="90" height="81"/>
<SubTexture name="BF Dies pixel0002" x="200" y="0" width="90" height="81"/>
Expand Down Expand Up @@ -58,8 +60,8 @@
<SubTexture name="BF Dies pixel0053" x="300" y="273" width="90" height="81"/>
<SubTexture name="BF Dies pixel0054" x="400" y="273" width="90" height="81"/>
<SubTexture name="BF Dies pixel0055" x="500" y="273" width="90" height="81"/>
<SubTexture name="BF Dies pixel0056" x="696" y="450" width="77" height="76"/>
<SubTexture name="BF Dies pixel0057" x="696" y="450" width="77" height="76"/>
<SubTexture name="BF Dies pixel0056" x="691" y="448" width="90" height="81"/>
<SubTexture name="BF Dies pixel0057" x="691" y="448" width="90" height="81"/>
<SubTexture name="RETRY CONFIRM0000" x="600" y="273" width="77" height="76"/>
<SubTexture name="RETRY CONFIRM0001" x="687" y="273" width="77" height="76"/>
<SubTexture name="RETRY CONFIRM0002" x="687" y="273" width="77" height="76"/>
Expand Down
131 changes: 64 additions & 67 deletions source/Character.hx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class Character extends FlxSprite
public var curCharacter:String = 'bf';

public var holdTimer:Float = 0;
public var singDuration:Float = 4;

public var animationNotes:Array<Dynamic> = [];

Expand Down Expand Up @@ -428,19 +429,30 @@ class Character extends FlxSprite
frames = Paths.getSparrowAtlas('charactersAssets/bfPixel', 'shared');
animation.addByPrefix('idle', 'BF IDLE', 24, false);
animation.addByPrefix('singUP', 'BF UP NOTE', 24, false);
animation.addByPrefix('singLEFT', 'BF LEFT NOTE', 24, false);
animation.addByPrefix('singRIGHT', 'BF RIGHT NOTE', 24, false);
if (!isPlayer)
{
animation.addByPrefix('singLEFT', 'BF RIGHT NOTE', 24, false);
animation.addByPrefix('singRIGHT', 'BF LEFT NOTE', 24, false);
}
else
{
animation.addByPrefix('singLEFT', 'BF LEFT NOTE', 24, false);
animation.addByPrefix('singRIGHT', 'BF RIGHT NOTE', 24, false);

// miss anims
animation.addByPrefix('singUPmiss', 'BF UP MISS', 24, false);
animation.addByPrefix('singLEFTmiss', 'BF LEFT MISS', 24, false);
animation.addByPrefix('singRIGHTmiss', 'BF RIGHT MISS', 24, false);
animation.addByPrefix('singDOWNmiss', 'BF DOWN MISS', 24, false);
}
animation.addByPrefix('singDOWN', 'BF DOWN NOTE', 24, false);
animation.addByPrefix('singUPmiss', 'BF UP MISS', 24, false);
animation.addByPrefix('singLEFTmiss', 'BF LEFT MISS', 24, false);
animation.addByPrefix('singRIGHTmiss', 'BF RIGHT MISS', 24, false);
animation.addByPrefix('singDOWNmiss', 'BF DOWN MISS', 24, false);

addOffset('idle');
addOffset("singUP");
addOffset("singRIGHT");
addOffset("singLEFT");
addOffset("singDOWN");

addOffset("singUPmiss");
addOffset("singRIGHTmiss");
addOffset("singLEFTmiss");
Expand All @@ -457,29 +469,6 @@ class Character extends FlxSprite
antialiasing = false;

flipX = true;

case 'bf-pixel-opponent':
frames = Paths.getSparrowAtlas('charactersAssets/bfPixel', 'shared');
animation.addByPrefix('idle', 'BF IDLE', 24, false);
animation.addByPrefix('singUP', 'BF UP NOTE', 24, false);
animation.addByPrefix('singLEFT', 'BF RIGHT NOTE', 24, false);
animation.addByPrefix('singRIGHT', 'BF LEFT NOTE', 24, false);
animation.addByPrefix('singDOWN', 'BF DOWN NOTE', 24, false);

addOffset('idle');
addOffset("singUP");
addOffset("singRIGHT");
addOffset("singLEFT");
addOffset("singDOWN");

setGraphicSize(Std.int(width * 7));
updateHitbox();

playAnim('idle');

width -= 100;
height -= 100;

antialiasing = false;

case 'bf-pixel-dead':
Expand Down Expand Up @@ -664,6 +653,7 @@ class Character extends FlxSprite
}

dance();
animation.finish();

if (isPlayer)
{
Expand Down Expand Up @@ -710,28 +700,37 @@ class Character extends FlxSprite

override function update(elapsed:Float)
{
if (!curCharacter.startsWith('bf'))
if (!isPlayer)
{
if (animation.curAnim.name.startsWith('sing'))
{
holdTimer += elapsed;
}

var dadVar:Float = 4;

if (curCharacter == 'dad')
dadVar = 6.1;
if (holdTimer >= Conductor.stepCrochet * dadVar * 0.001)
if (holdTimer >= Conductor.stepCrochet * 0.0011 * singDuration)
{
dance();
holdTimer = 0;
}

// some characters need to hold their poses longer because it looks weird to me....
switch (curCharacter)
{
case 'dad':
singDuration = 6.1;
case 'gf' | 'spooky':
singDuration = 4.2; // to fix the double dances
}
}

if (!debugMode)
{
if(animation.curAnim.finished && animation.getByName(animation.curAnim.name + '-loop') != null)
playAnim(animation.curAnim.name + '-loop');
if (animation.getByName(animation.curAnim.name + '-loop') != null)
{
if (animation.curAnim.finished) {
playAnim(animation.curAnim.name + '-loop');
}
}
}

switch (curCharacter)
Expand Down Expand Up @@ -765,46 +764,44 @@ class Character extends FlxSprite

private var danced:Bool = false;

/**
* FOR GF DANCING SHIT
*/
public function dance()
// FOR GF DANCING SHIT
public function dance()
{
if (!debugMode)
{
if (!debugMode)
switch (curCharacter)
{
switch (curCharacter)
{
case 'gf' | 'gf-car' | 'gf-christmas' | 'gf-pixel' | 'gf-tankmen':
if (!animation.curAnim.name.startsWith('hair'))
{
danced = !danced;

if (danced)
playAnim('danceRight');
else
playAnim('danceLeft');
}
case 'bf-pixel-dead':
// do nothing, just act casual lol
case 'bf-holding-gf-DEAD':
// do nothing, just act casual lol
case 'pico-speaker':
// do nothing, just act casual lol
case 'spooky':
case 'gf' | 'gf-car' | 'gf-christmas' | 'gf-pixel' | 'gf-tankmen':
if (!animation.curAnim.name.startsWith('hair'))
{
danced = !danced;

if (danced)
playAnim('danceRight');
else
playAnim('danceLeft');
case 'tankman':
if (!animation.curAnim.name.endsWith('DOWN-alt'))
playAnim('idle');
default:
playAnim('idle');
}
}
case 'bf-pixel-dead':
// do nothing, just act casual lol
case 'bf-holding-gf-DEAD':
// do nothing, just act casual lol
case 'pico-speaker':
// do nothing, just act casual lol
case 'spooky':
danced = !danced;

if (danced)
playAnim('danceRight');
else
playAnim('danceLeft');
case 'tankman':
if (!animation.curAnim.name.endsWith('DOWN-alt'))
playAnim('idle');
default:
playAnim('idle');
}
}
}

public function playAnim(AnimName:String, Force:Bool = false, Reversed:Bool = false, Frame:Int = 0):Void
{
Expand Down
25 changes: 15 additions & 10 deletions source/LoadingState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ class LoadingState extends MusicBeatState
var stopMusic = false;
var callbacks:MultiCallback;

var logo:FlxSprite;
var gfDance:FlxSprite;
var danceLeft = false;

function new(target:FlxState, stopMusic:Bool)
{
super();
Expand All @@ -38,6 +34,7 @@ class LoadingState extends MusicBeatState

var funkay:FlxSprite;
var loadBar:FlxSprite;

override function create()
{
var bg:FlxSprite = new FlxSprite(0, 0).makeGraphic(FlxG.width, FlxG.height, 0xffcaff4d);
Expand All @@ -63,9 +60,11 @@ class LoadingState extends MusicBeatState
callbacks = new MultiCallback(onLoad);
var introComplete = callbacks.add("introComplete");
checkLoadSong(getSongPath());

if (PlayState.SONG.needsVoices)
checkLoadSong(getVocalPath());
checkLibrary("shared");

if (PlayState.storyWeek > 0)
checkLibrary("week" + PlayState.storyWeek);
else
Expand All @@ -84,10 +83,6 @@ class LoadingState extends MusicBeatState
{
var library = Assets.getLibrary("songs");
final symbolPath = path.split(":").pop();
// @:privateAccess
// library.types.set(symbolPath, SOUND);
// @:privateAccess
// library.pathGroups.set(symbolPath, [library.__cacheBreak(symbolPath)]);
var callback = callbacks.add("song:" + path);
Assets.loadSound(path).onComplete(function (_) { callback(); });
}
Expand Down Expand Up @@ -120,10 +115,18 @@ class LoadingState extends MusicBeatState
funkay.updateHitbox();
}

if(callbacks != null) {
if(callbacks != null)
{
targetShit = FlxMath.remapToRange(callbacks.numRemaining / callbacks.length, 1, 0, 0, 1);
loadBar.scale.x += 0.5 * (targetShit - loadBar.scale.x);

var lerpWidth:Int = Std.int(FlxMath.lerp(loadBar.width, FlxG.width * targetShit, 0.2));
loadBar.setGraphicSize(lerpWidth, FlxG.height);
loadBar.updateHitbox();
}

#if debug
if (FlxG.keys.justPressed.SPACE) trace('fired: ' + callbacks.getFired() + ' unfired:' + callbacks.getUnfired());
#end
}

function onLoad()
Expand Down Expand Up @@ -152,12 +155,14 @@ class LoadingState extends MusicBeatState
static function getNextState(target:FlxState, stopMusic = false):FlxState
{
Paths.setCurrentLevel("week" + PlayState.storyWeek);

var loaded = isSoundLoaded(getSongPath())
&& (!PlayState.SONG.needsVoices || isSoundLoaded(getVocalPath()))
&& isLibraryLoaded("shared");

if (!loaded)
return new LoadingState(target, stopMusic);

if (stopMusic && FlxG.sound.music != null)
FlxG.sound.music.stop();

Expand Down
5 changes: 3 additions & 2 deletions source/MainMenuState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class MainMenuState extends MusicBeatState
#if !switch
var optionShit:Array<String> = ['story mode', 'freeplay', 'donate', 'options'];
#else
var optionShit:Array<String> = ['story mode', 'freeplay'];
var optionShit:Array<String> = ['story mode', 'freeplay', 'options'];
#end

var magenta:FlxSprite;
Expand Down Expand Up @@ -81,7 +81,8 @@ class MainMenuState extends MusicBeatState
magenta.visible = false;
magenta.antialiasing = true;
magenta.color = 0xFFFD719B;
magenta.scrollFactor.set();
if (FlxG.save.data.flashingLights)
add(magenta);

menuItems = new MainMenuList();
add(menuItems);
Expand Down
Loading

0 comments on commit 44b9b75

Please sign in to comment.