diff --git a/art/flashFiles/Dad_assets.fla b/art/flashFiles/Dad_assets.fla index bfc25c3..c963a2c 100644 Binary files a/art/flashFiles/Dad_assets.fla and b/art/flashFiles/Dad_assets.fla differ diff --git a/assets/shared/images/characters/DADDY_DEAREST.png b/assets/shared/images/characters/DADDY_DEAREST.png index 6acb600..35741dc 100644 Binary files a/assets/shared/images/characters/DADDY_DEAREST.png and b/assets/shared/images/characters/DADDY_DEAREST.png differ diff --git a/assets/shared/images/characters/DADDY_DEAREST.xml b/assets/shared/images/characters/DADDY_DEAREST.xml index eaa7594..87f4fd9 100644 --- a/assets/shared/images/characters/DADDY_DEAREST.xml +++ b/assets/shared/images/characters/DADDY_DEAREST.xml @@ -1,50 +1,129 @@  - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/building.md b/docs/building.md index e824a0f..5b0b6b1 100644 --- a/docs/building.md +++ b/docs/building.md @@ -61,5 +61,6 @@ Since you already installed `git` in a previous step, we'll use it to clone the Finally, we are ready to build. - Run `lime build `, replacing `` with the platform you want to build to (`windows`, `mac`, `linux`, `html5`) (i.e. `lime build windows`) -- The build will be in `Kade-Engine/export//bin`, with `` being the target you built to in the previous step. (i.e. `Kade-Engine/export/windows/bin`) -- Only the `bin` folder is necessary to run the game. The other ones in `export/` are not. +- The build will be in `Kade-Engine/export/release//bin`, with `` being the target you built to in the previous step. (i.e. `Kade-Engine/export/release/windows/bin`) +- Incase you added the -debug flag the files will be inside `Kade-Engine/export/debug//bin` +- Only the `bin` folder is necessary to run the game. The other ones in `export/release/` are not. diff --git a/source/Alphabet.hx b/source/Alphabet.hx index e376150..dc3484a 100644 --- a/source/Alphabet.hx +++ b/source/Alphabet.hx @@ -47,11 +47,20 @@ class Alphabet extends FlxSpriteGroup var pastX:Float = 0; var pastY:Float = 0; - public function new(x:Float, y:Float, text:String = "", ?bold:Bool = false, typed:Bool = false, shouldMove:Bool = false) + // ThatGuy: Variables here to be used later + var xScale:Float; + var yScale:Float; + + // ThatGuy: Added 2 more variables, xScale and yScale for resizing text + public function new(x:Float, y:Float, text:String = "", ?bold:Bool = false, typed:Bool = false, shouldMove:Bool = false, xScale:Float = 1, yScale:Float = 1) { pastX = x; pastY = y; + // ThatGuy: Have to assign these variables + this.xScale = xScale; + this.yScale = yScale; + super(x, y); _finalText = text; @@ -72,7 +81,7 @@ class Alphabet extends FlxSpriteGroup } } - public function reType(text) + public function reType(text, xScale:Float = 1, yScale:Float = 1) { for (i in listOAlphabets) remove(i); @@ -86,6 +95,9 @@ class Alphabet extends FlxSpriteGroup listOAlphabets.clear(); x = pastX; y = pastY; + + this.xScale = xScale; + this.yScale = yScale; addText(); } @@ -111,17 +123,24 @@ class Alphabet extends FlxSpriteGroup { if (lastSprite != null) { - xPos = lastSprite.x + lastSprite.width; + // ThatGuy: This is the line that fixes the spacing error when the x position of this class's objects was anything other than 0 + xPos = lastSprite.x - pastX + lastSprite.width; } if (lastWasSpace) { - xPos += 40; + // ThatGuy: Also this line + xPos += 40 * xScale; lastWasSpace = false; } // var letter:AlphaCharacter = new AlphaCharacter(30 * loopNum, 0); var letter:AlphaCharacter = new AlphaCharacter(xPos, 0); + + // ThatGuy: These are the lines that change the individual scaling of each character + letter.scale.set(xScale, yScale); + letter.updateHitbox(); + listOAlphabets.add(letter); if (isBold) @@ -147,6 +166,7 @@ class Alphabet extends FlxSpriteGroup public var personTalking:String = 'gf'; + // ThatGuy: THIS FUNCTION ISNT CHANGED! Because i dont use it lol public function startTypedText():Void { _finalText = text; @@ -261,6 +281,37 @@ class Alphabet extends FlxSpriteGroup super.update(elapsed); } + + // ThatGuy: Ooga booga function for resizing text, with the option of wanting it to have the same midPoint + // Side note: Do not, EVER, do updateHitbox() unless you are retyping the whole thing. Don't know why, but the position gets retarded if you do that + public function resizeText(xScale:Float, yScale:Float, xStaysCentered:Bool = true, yStaysCentered:Bool = false):Void { + var oldWidth:Float = this.width; + var oldHeight:Float = this.height; + //trace('old x before scaling: ' + this.x); + //trace('old midpoint before scaling: ' + this.getMidpoint().x); + reType(text, xScale, yScale); + //trace('old x after scaling: ' + this.x); + //trace('old midpoint after scaling: ' + this.getMidpoint().x); + //This works, commenting out all the tracing + if(xStaysCentered) { + /* + If oldX is the old position, that is the same for both sizes of text, e.g. oldX = 50 + And oldWidth is the old width of the text, e.g. oldWidth = 100 + And newWidth is the current width of the text, e.g. newWidth= 150 + And the midpoint, is always the same, e.g. midpoint = oldX + oldWidth/2 = 50 + 100/2 = 100 + and the newMidpoint, which is equal to midpoint, is newX + newWidth/2, then + newX = midpoint - newWidth/2 <=> newX = oldX + oldWidth/2 - newWidth/2, e.g., <=> newX = 50 + 100/2 - 150/2 <=> newX = 25 + */ + //Since this.x doesnt change with text scaling, in this equation, this.x can be used as both the old and the new x + this.x = this.x + oldWidth/2 - this.width/2; + //trace('new x after scaling: ' + this.x); + //trace('new midpoint after scaling: ' + this.getMidpoint().x); + } + if(yStaysCentered) { + // Same logic applies here + this.y = this.y + oldHeight/2 - this.height/2; + } + } } class AlphaCharacter extends FlxSprite @@ -278,7 +329,10 @@ class AlphaCharacter extends FlxSprite super(x, y); var tex = Paths.getSparrowAtlas('alphabet'); frames = tex; - antialiasing = FlxG.save.data.antialiasing; + if(FlxG.save.data.antialiasing) + { + antialiasing = true; + } } public function createBold(letter:String) diff --git a/source/Paths.hx b/source/Paths.hx index 8de63a8..8c8f184 100644 --- a/source/Paths.hx +++ b/source/Paths.hx @@ -170,6 +170,6 @@ class Paths #end else return FlxAtlasFrames.fromSpriteSheetPacker(image('characters/$key'), file('images/characters/$key.txt', library)); - return FlxAtlasFrames.fromSpriteSheetPacker(image(key, library), file('images/characters/$key.txt', library)); + return FlxAtlasFrames.fromSpriteSheetPacker(image(key, library), file('images/$key.txt', library)); } } diff --git a/source/PlayState.hx b/source/PlayState.hx index f923bf5..17fd3ac 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -194,7 +194,7 @@ class PlayState extends MusicBeatState var notesHitArray:Array = []; var currentFrames:Int = 0; - var idleToBeat:Bool = true; // change if bf and dad would idle to the beat of the song + var idleToBeat:Bool = false; // change if bf and dad would idle to the beat of the song var idleBeat:Int = 4; // how frequently bf and dad would play their idle animation(1 - every beat, 2 - every 2 beats and so on) public var dialogue:Array = ['dad:blah blah blah', 'bf:coolswag']; @@ -3259,6 +3259,17 @@ class PlayState extends MusicBeatState spr.centerOffsets(); } }); + if (PlayStateChangeables.botPlay) + { + playerStrums.forEach(function(spr:FlxSprite) + { + if (spr.animation.finished) + { + spr.animation.play('static'); + spr.centerOffsets(); + } + }); + } } if (!inCutscene && songStarted) @@ -3928,6 +3939,24 @@ class PlayState extends MusicBeatState { goodNoteHit(daNote); boyfriend.holdTimer = daNote.sustainLength; + if (FlxG.save.data.cpuStrums) + { + playerStrums.forEach(function(spr:FlxSprite) + { + if (Math.abs(daNote.noteData) == spr.ID) + { + spr.animation.play('confirm', true); + } + if (spr.animation.curAnim.name == 'confirm' && !curStage.startsWith('school')) + { + spr.centerOffsets(); + spr.offset.x -= 13; + spr.offset.y -= 13; + } + else + spr.centerOffsets(); + }); + } } } } @@ -3939,22 +3968,25 @@ class PlayState extends MusicBeatState boyfriend.playAnim('idle'); } - playerStrums.forEach(function(spr:FlxSprite) + if (!PlayStateChangeables.botPlay) { - if (keys[spr.ID] && spr.animation.curAnim.name != 'confirm') - spr.animation.play('pressed', false); - if (!keys[spr.ID]) - spr.animation.play('static', false); - - if (spr.animation.curAnim.name == 'confirm' && !curStage.startsWith('school')) + playerStrums.forEach(function(spr:FlxSprite) { - spr.centerOffsets(); - spr.offset.x -= 13; - spr.offset.y -= 13; - } - else - spr.centerOffsets(); - }); + if (keys[spr.ID] && spr.animation.curAnim.name != 'confirm') + spr.animation.play('pressed', false); + if (!keys[spr.ID]) + spr.animation.play('static', false); + + if (spr.animation.curAnim.name == 'confirm' && !curStage.startsWith('school')) + { + spr.centerOffsets(); + spr.offset.x -= 13; + spr.offset.y -= 13; + } + else + spr.centerOffsets(); + }); + } } public function findByTime(time:Float):Array diff --git a/source/ResultsScreen.hx b/source/ResultsScreen.hx index c066041..5e39fce 100644 --- a/source/ResultsScreen.hx +++ b/source/ResultsScreen.hx @@ -88,7 +88,7 @@ class ResultsScreen extends FlxSubState var bads = PlayState.isStoryMode ? PlayState.campaignBads : PlayState.bads; var shits = PlayState.isStoryMode ? PlayState.campaignShits : PlayState.shits; - comboText = new FlxText(20,-75,0,'Judgements:\nSicks - ${PlayState.sicks}\nGoods - ${sicks}\nBads - ${bads}\n\nCombo Breaks: ${(PlayState.isStoryMode ? PlayState.campaignMisses : PlayState.misses)}\nHighest Combo: ${PlayState.highestCombo + 1}\nScore: ${PlayState.instance.songScore}\nAccuracy: ${HelperFunctions.truncateFloat(PlayState.instance.accuracy,2)}%\n\n${Ratings.GenerateLetterRank(PlayState.instance.accuracy)}\n\n${!PlayState.loadRep ? "F1 - View replay\nF2 - Replay song" : ""} + comboText = new FlxText(20,-75,0,'Judgements:\nSicks - ${sicks}\nGoods - ${goods}\nBads - ${bads}\n\nCombo Breaks: ${(PlayState.isStoryMode ? PlayState.campaignMisses : PlayState.misses)}\nHighest Combo: ${PlayState.highestCombo + 1}\nScore: ${PlayState.instance.songScore}\nAccuracy: ${HelperFunctions.truncateFloat(PlayState.instance.accuracy,2)}%\n\n${Ratings.GenerateLetterRank(PlayState.instance.accuracy)}\n\n${!PlayState.loadRep ? "F1 - View replay\nF2 - Replay song" : ""} '); comboText.size = 28; comboText.setBorderStyle(FlxTextBorderStyle.OUTLINE,FlxColor.BLACK,4,1);