Skip to content

Commit

Permalink
Merge pull request #1 from hellosammu/master
Browse files Browse the repository at this point in the history
Some fixes
  • Loading branch information
ImCodist authored Sep 11, 2021
2 parents 82123b8 + fe73d70 commit ab0a77e
Show file tree
Hide file tree
Showing 7 changed files with 129 additions and 32 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ I don't care how big this section gets over time, I will actually keep expanding
[ImCodist](https://github.com/ImCodist) - helped with a couple of pull requests and issue fixes, but, I'm not gonna give him any credit at all, because he stole my obsidian soul in minecraft and I will never forgive him for that!!!!

[HelloSammu](https://github.com/hellosammu) - weird catgirl programmer, they scare me
CREDITED MAINTENANCE AND SOME MISC FIXES

[ninjamuffin99](https://ninjamuffin99.newgrounds.com/) - HE MADE THE BASE GAME SO LIKE WITHOUT HIM THIS WOULD NOT BE POSSIBLE GO CHECK HIM OUT RIGHT NOW

Expand Down
38 changes: 26 additions & 12 deletions source/gameFolder/gameObjects/Character.hx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ using StringTools;

class Character extends FNFSprite
{
// By default, this option set to FALSE will make it so that the character only dances twice per major beat hit
// If set to on, they will dance every beat, such as Skid and Pump
public var quickDancer:Bool = false;

public var debugMode:Bool = false;

public var isPlayer:Bool = false;
Expand Down Expand Up @@ -131,6 +135,8 @@ class Character extends FNFSprite
animation.addByIndices('danceLeft', 'spooky dance idle', [0, 2, 6], "", 12, false);
animation.addByIndices('danceRight', 'spooky dance idle', [8, 10, 12, 14], "", 12, false);

quickDancer = true;

playAnim('danceRight');
case 'mom':
tex = Paths.getSparrowAtlas('characters/Mom_Assets');
Expand All @@ -154,6 +160,7 @@ class Character extends FNFSprite
frames = tex;

animation.addByPrefix('idle', "Mom Idle", 24, false);
animation.addByIndices('idlePost', 'Mom Idle', [10, 11, 12, 13], "", 24, true);
animation.addByPrefix('singUP', "Mom Up Pose", 24, false);
animation.addByPrefix('singDOWN', "MOM DOWN POSE", 24, false);
animation.addByPrefix('singLEFT', 'Mom Left Pose', 24, false);
Expand Down Expand Up @@ -311,6 +318,7 @@ class Character extends FNFSprite
var tex = Paths.getSparrowAtlas('characters/bfCar');
frames = tex;
animation.addByPrefix('idle', 'BF idle dance', 24, false);
animation.addByIndices('idlePost', 'BF idle dance', [8, 9, 10, 11, 12, 13, 14], "", 24, true);
animation.addByPrefix('singUP', 'BF NOTE UP0', 24, false);
animation.addByPrefix('singLEFT', 'BF NOTE LEFT0', 24, false);
animation.addByPrefix('singRIGHT', 'BF NOTE RIGHT0', 24, false);
Expand Down Expand Up @@ -548,6 +556,15 @@ class Character extends FNFSprite
playAnim('danceLeft');
}

// Post idle animation (think Week 4 and how the player and mom's hair continues to sway after their idle animations are done!)
if (animation.curAnim.finished && animation.curAnim.name == 'idle')
{
// We look for an animation called 'idlePost' to switch to
if (animation.getByName('idlePost') != null)
// (( WE DON'T USE 'PLAYANIM' BECAUSE WE WANT TO FEED OFF OF THE IDLE OFFSETS! ))
animation.play('idlePost', true, false, 0);
}

super.update(elapsed);
}

Expand All @@ -556,7 +573,7 @@ class Character extends FNFSprite
/**
* FOR GF DANCING SHIT
*/
public function dance()
public function dance(?forced:Bool = false)
{
if (!debugMode)
{
Expand All @@ -569,20 +586,17 @@ class Character extends FNFSprite
danced = !danced;

if (danced)
playAnim('danceRight');
playAnim('danceRight', forced);
else
playAnim('danceLeft');
playAnim('danceLeft', forced);
}

case 'spooky':
danced = !danced;

if (danced)
playAnim('danceRight');
else
playAnim('danceLeft');
default:
playAnim('idle');
// Left/right dancing, think Skid & Pump
if (animation.getByName('danceLeft') != null && animation.getByName('danceRight') != null)
playAnim((animation.curAnim.name == 'danceRight') ? 'danceLeft' : 'danceRight', forced);
// Play normal idle animations for all other characters
else
playAnim('idle', forced);
}
}
}
Expand Down
20 changes: 16 additions & 4 deletions source/gameFolder/gameObjects/Stage.hx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ import flixel.group.FlxSpriteGroup;
import flixel.math.FlxPoint;
import flixel.system.FlxSound;
import flixel.text.FlxText;
import flixel.tweens.FlxTween;
import gameFolder.gameObjects.background.*;
import gameFolder.meta.CoolUtil;
import gameFolder.meta.data.Conductor;
import gameFolder.meta.data.dependency.FNFSprite;
import gameFolder.meta.state.PlayState;

Expand Down Expand Up @@ -501,15 +503,27 @@ class Stage extends FlxTypedGroup<FlxBasic>

if (curBeat % 4 == 0)
{
var lastLight:FlxSprite = phillyCityLights.members[0];

phillyCityLights.forEach(function(light:FNFSprite)
{
// Take note of the previous light
if (light.visible == true)
lastLight = light;

light.visible = false;
});

curLight = FlxG.random.int(0, phillyCityLights.length - 1);
// To prevent duplicate lights, iterate until you get a matching light
while (lastLight == phillyCityLights.members[curLight])
{
curLight = FlxG.random.int(0, phillyCityLights.length - 1);
}

phillyCityLights.members[curLight].visible = true;
// phillyCityLights.members[curLight].alpha = 1;
phillyCityLights.members[curLight].alpha = 1;

FlxTween.tween(phillyCityLights.members[curLight], {alpha: 0}, Conductor.stepCrochet * .016);
}

if (curBeat % 8 == 4 && FlxG.random.bool(30) && !trainMoving && trainCooldown > 8)
Expand All @@ -518,7 +532,6 @@ class Stage extends FlxTypedGroup<FlxBasic>
trainStart();
}
}
//
}

public function stageUpdateConstant(elapsed:Float, boyfriend:Boyfriend, gf:Character, dadOpponent:Character)
Expand All @@ -536,7 +549,6 @@ class Stage extends FlxTypedGroup<FlxBasic>
trainFrameTiming = 0;
}
}
// phillyCityLights.members[curLight].alpha -= (Conductor.crochet / 1000) * FlxG.elapsed;
}
}

Expand Down
73 changes: 73 additions & 0 deletions source/gameFolder/meta/data/font/Dialogue.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
package gameFolder.meta.data.font;

import flixel.group.FlxSpriteGroup;
import flixel.math.FlxPoint;
import flixel.util.FlxTimer;
import gameFolder.meta.data.font.Alphabet.AlphaCharacter;

using StringTools;

class Dialogue extends FlxSpriteGroup
{
public var textSpeed:Float = 0.05;
public var textSize:Float = 1;
public var textPosition:Int = 0;

private var _buildText:String;
private var _finalText:String;

private var splitWords:Array<String> = [];

private var dialogueMaxSize:FlxPoint;

public function new(x:Float, y:Float, text:String = "", width:Int, height:Int)
{
super(x, y);
_finalText = text;
dialogueMaxSize = new FlxPoint(width, height);
}

public function buildText():Void
{
// Reset values on the hypothetical that the text was started over
textPosition = 0;

var curRow = 0;
var loopNum = 0;
var lastWasSpace = false;

// Clear out all the old sprites if there are any
if (_sprites.length > 0)
{
for (_sprite in _sprites)
{
_sprite.destroy();
}
clear();
}

// Split all of the text into an array
splitWords = _finalText.split("");

new FlxTimer().start(textSpeed, function(timer:FlxTimer)
{
if (_finalText.fastCodeAt(loopNum) == "\n".code)
{
curRow++;
}

if (splitWords[curRow] == " ")
{
lastWasSpace = true;
}

#if (haxe >= "4.0.0")
var isNumber:Bool = AlphaCharacter.numbers.contains(splitWords[curRow]);
var isSymbol:Bool = AlphaCharacter.symbols.contains(splitWords[curRow]);
#else
var isNumber:Bool = AlphaCharacter.numbers.indexOf(splitWords[curRow]) != -1;
var isSymbol:Bool = AlphaCharacter.symbols.indexOf(splitWords[curRow]) != -1;
#end
});
}
}
4 changes: 2 additions & 2 deletions source/gameFolder/meta/state/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -1380,11 +1380,11 @@ class PlayState extends MusicBeatState
if ((curBeat % gfSpeed == 0) && (!gf.animation.curAnim.name.startsWith("sing")))
gf.dance();

if (!boyfriend.animation.curAnim.name.startsWith("sing"))
if (!boyfriend.animation.curAnim.name.startsWith("sing") && (curBeat % 2 == 0 || boyfriend.quickDancer))
boyfriend.dance();

// added this for opponent cus it wasn't here before and skater would just freeze
if (!dadOpponent.animation.curAnim.name.startsWith("sing"))
if (!dadOpponent.animation.curAnim.name.startsWith("sing") && (curBeat % 2 == 0 || dadOpponent.quickDancer))
dadOpponent.dance();
}

Expand Down
23 changes: 10 additions & 13 deletions source/gameFolder/meta/state/menus/FreeplayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -113,16 +113,16 @@ class FreeplayState extends MusicBeatState
}

scoreText = new FlxText(FlxG.width * 0.7, 5, 0, "", 32);
// scoreText.autoSize = false;
scoreText.setFormat(Paths.font("vcr.ttf"), 32, FlxColor.WHITE, RIGHT);
// scoreText.alignment = RIGHT;

scoreBG = new FlxSprite(scoreText.x - 6, 0).makeGraphic(Std.int(FlxG.width * 0.35), 66, 0xFF000000);
scoreBG = new FlxSprite(scoreText.x - scoreText.width, 0).makeGraphic(Std.int(FlxG.width * 0.35), 66, 0xFF000000);
scoreBG.alpha = 0.6;
add(scoreBG);

diffText = new FlxText(scoreText.x, scoreText.y + 36, 0, "", 24);
diffText.alignment = CENTER;
diffText.font = scoreText.font;
diffText.x = scoreBG.getGraphicMidpoint().x;
add(diffText);

add(scoreText);
Expand Down Expand Up @@ -191,16 +191,6 @@ class FreeplayState extends MusicBeatState
if (Math.abs(lerpScore - intendedScore) <= 10)
lerpScore = intendedScore;

scoreText.text = "PERSONAL BEST:" + lerpScore;

// score bg handling
scoreBG.width = ((scoreText.size * scoreText.text.length) + 8);
scoreBG.updateHitbox();
scoreBG.x = (FlxG.width - scoreBG.width);

scoreText.x = (scoreBG.x + 4);
//

var upP = controls.UP_P;
var downP = controls.DOWN_P;
var accepted = controls.ACCEPT;
Expand Down Expand Up @@ -237,6 +227,13 @@ class FreeplayState extends MusicBeatState

Main.switchState(this, new PlayState());
}

// Adhere the position of all the things (I'm sorry it was just so ugly before I had to fix it Shubs)
scoreText.text = "PERSONAL BEST:" + lerpScore;
scoreText.x = FlxG.width - scoreText.width - 5;
scoreBG.width = scoreText.width + 8;
scoreBG.x = FlxG.width - scoreBG.width;
diffText.x = scoreBG.x + (scoreBG.width / 2) - (diffText.width / 2);
}

var lastDifficulty:String;
Expand Down
2 changes: 1 addition & 1 deletion source/gameFolder/meta/state/menus/StoryMenuState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ class StoryMenuState extends MusicBeatState
stopspamming = true;
}

PlayState.storyPlaylist = Main.gameWeeks[curWeek][0];
PlayState.storyPlaylist = Main.gameWeeks[curWeek][0].copy();
PlayState.isStoryMode = true;
selectedWeek = true;

Expand Down

0 comments on commit ab0a77e

Please sign in to comment.