diff --git a/source/Character.hx b/source/Character.hx index eb3d09299..2a95a869a 100644 --- a/source/Character.hx +++ b/source/Character.hx @@ -105,6 +105,22 @@ class Character extends FlxSprite playAnim('danceRight'); + case 'gf-pixel': + tex = FlxAtlasFrames.fromSparrow('assets/images/weeb/gfPixel.png', 'assets/images/weeb/gfPixel.xml'); + frames = tex; + animation.addByIndices('singUP', 'GF IDLE', [2], "", 24, false); + animation.addByIndices('danceLeft', 'GF IDLE', [30, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14], "", 24, false); + animation.addByIndices('danceRight', 'GF IDLE', [15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29], "", 24, false); + + addOffset('danceLeft', 0); + addOffset('danceRight', 0); + + playAnim('danceRight'); + + setGraphicSize(Std.int(width * PlayState.daPixelZoom)); + updateHitbox(); + antialiasing = false; + case 'dad': // DAD ANIMATION LOADING CODE tex = FlxAtlasFrames.fromSparrow('assets/images/DADDY_DEAREST.png', 'assets/images/DADDY_DEAREST.xml'); @@ -493,6 +509,16 @@ class Character extends FlxSprite else playAnim('danceLeft'); } + case 'gf-pixel': + if (!animation.curAnim.name.startsWith('hair')) + { + danced = !danced; + + if (danced) + playAnim('danceRight'); + else + playAnim('danceLeft'); + } case 'spooky': danced = !danced; diff --git a/source/Note.hx b/source/Note.hx index adbe6d984..ca57a64f2 100644 --- a/source/Note.hx +++ b/source/Note.hx @@ -2,7 +2,9 @@ package; import flixel.FlxSprite; import flixel.graphics.frames.FlxAtlasFrames; +import flixel.math.FlxMath; import flixel.util.FlxColor; +import polymod.format.ParseRules.TargetSignatureElement; class Note extends FlxSprite { @@ -43,26 +45,58 @@ class Note extends FlxSprite this.noteData = noteData; - var tex = FlxAtlasFrames.fromSparrow('assets/images/NOTE_assets.png', 'assets/images/NOTE_assets.xml'); - frames = tex; - animation.addByPrefix('greenScroll', 'green0'); - animation.addByPrefix('redScroll', 'red0'); - animation.addByPrefix('blueScroll', 'blue0'); - animation.addByPrefix('purpleScroll', 'purple0'); + var daStage:String = PlayState.curStage; - animation.addByPrefix('purpleholdend', 'pruple end hold'); - animation.addByPrefix('greenholdend', 'green hold end'); - animation.addByPrefix('redholdend', 'red hold end'); - animation.addByPrefix('blueholdend', 'blue hold end'); + switch (daStage) + { + case 'school': + loadGraphic('assets/images/weeb/pixelUI/arrows-pixels.png', true, 17, 17); - animation.addByPrefix('purplehold', 'purple hold piece'); - animation.addByPrefix('greenhold', 'green hold piece'); - animation.addByPrefix('redhold', 'red hold piece'); - animation.addByPrefix('bluehold', 'blue hold piece'); + animation.add('greenScroll', [6]); + animation.add('redScroll', [7]); + animation.add('blueScroll', [5]); + animation.add('purpleScroll', [4]); - setGraphicSize(Std.int(width * 0.7)); - updateHitbox(); - antialiasing = true; + if (isSustainNote) + { + loadGraphic('assets/images/weeb/pixelUI/arrowEnds.png', true, 7, 6); + + animation.add('purpleholdend', [4]); + animation.add('greenholdend', [6]); + animation.add('redholdend', [7]); + animation.add('blueholdend', [5]); + + animation.add('purplehold', [0]); + animation.add('greenhold', [2]); + animation.add('redhold', [3]); + animation.add('bluehold', [1]); + } + + setGraphicSize(Std.int(width * PlayState.daPixelZoom)); + updateHitbox(); + + default: + frames = FlxAtlasFrames.fromSparrow('assets/images/NOTE_assets.png', 'assets/images/NOTE_assets.xml'); + + animation.addByPrefix('greenScroll', 'green0'); + animation.addByPrefix('redScroll', 'red0'); + animation.addByPrefix('blueScroll', 'blue0'); + animation.addByPrefix('purpleScroll', 'purple0'); + + animation.addByPrefix('purpleholdend', 'pruple end hold'); + animation.addByPrefix('greenholdend', 'green hold end'); + animation.addByPrefix('redholdend', 'red hold end'); + animation.addByPrefix('blueholdend', 'blue hold end'); + + animation.addByPrefix('purplehold', 'purple hold piece'); + animation.addByPrefix('greenhold', 'green hold piece'); + animation.addByPrefix('redhold', 'red hold piece'); + animation.addByPrefix('bluehold', 'blue hold piece'); + + setGraphicSize(Std.int(width * 0.7)); + updateHitbox(); + antialiasing = true; + } switch (noteData) { @@ -120,7 +154,7 @@ class Note extends FlxSprite } prevNote.offset.y = -19; - prevNote.scale.y *= (2.25 * PlayState.SONG.speed); + prevNote.scale.y *= (2.25 * FlxMath.roundDecimal(PlayState.SONG.speed, 1)); // prevNote.setGraphicSize(); } } diff --git a/source/PlayState.hx b/source/PlayState.hx index 64c4c6375..be71c95a7 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -36,7 +36,6 @@ using StringTools; class PlayState extends MusicBeatState { - public static var curLevel:String = 'Tutorial'; public static var curStage:String = ''; public static var SONG:SwagSong; public static var isStoryMode:Bool = false; @@ -97,6 +96,8 @@ class PlayState extends MusicBeatState var bottomBoppers:FlxSprite; var santa:FlxSprite; + var bgGirls:FlxSprite; + var talking:Bool = true; var songScore:Int = 0; var scoreTxt:FlxText; @@ -105,6 +106,9 @@ class PlayState extends MusicBeatState var defaultCamZoom:Float = 1.05; + // how big to stretch the pixel art assets + public static var daPixelZoom:Float = 6; + override public function create() { // var gameCam:FlxCamera = FlxG.camera; @@ -121,7 +125,7 @@ class PlayState extends MusicBeatState persistentDraw = true; if (SONG == null) - SONG = Song.loadFromJson(curLevel); + SONG = Song.loadFromJson('tutorial'); Conductor.changeBPM(SONG.bpm); @@ -340,6 +344,7 @@ class PlayState extends MusicBeatState add(bgSchool); var bgStreet:FlxSprite = new FlxSprite(-200).loadGraphic('assets/images/weeb/weebStreet.png'); + bgStreet.scrollFactor.set(0.95, 0.95); add(bgStreet); var widShit = Std.int(bgSky.width * 6); @@ -392,6 +397,8 @@ class PlayState extends MusicBeatState gfVersion = 'gf-christmas'; case 'mallEvil': gfVersion = 'gf-christmas'; + case 'school': + gfVersion = 'gf-pixel'; } if (curStage == 'limo') @@ -399,7 +406,6 @@ class PlayState extends MusicBeatState gf = new Character(400, 130, gfVersion); gf.scrollFactor.set(0.95, 0.95); - gf.antialiasing = true; add(gf); // Shitty layering but whatev it works LOL @@ -459,6 +465,8 @@ class PlayState extends MusicBeatState case 'school': boyfriend.x += 100; boyfriend.y += 100; + gf.x += 100; + gf.y += 200; } var doof:DialogueBox = new DialogueBox(false, dialogue); @@ -569,22 +577,49 @@ class PlayState extends MusicBeatState }); }); }); + case 'senpai': + schoolIntro(); default: startCountdown(); } } else { - startCountdown(); + switch (curSong.toLowerCase()) + { + case 'senpai': + schoolIntro(); + default: + startCountdown(); + } } - #if lime - trace("IT'S LIME"); - #end - super.create(); } + function schoolIntro():Void + { + var black:FlxSprite = new FlxSprite(-100, -100).makeGraphic(FlxG.width * 2, FlxG.height * 2, FlxColor.BLACK); + black.scrollFactor.set(); + add(black); + + new FlxTimer().start(0.3, function(tmr:FlxTimer) + { + black.alpha -= 0.15; + if (!startedCountdown) + startCountdown(); + + if (black.alpha > 0) + { + tmr.reset(0.3); + } + else + { + remove(black); + } + }); + } + var startTimer:FlxTimer; var perfectMode:Bool = false; @@ -606,13 +641,35 @@ class PlayState extends MusicBeatState gf.dance(); boyfriend.playAnim('idle'); + var introAssets:Map> = new Map>(); + introAssets.set('default', ['ready.png', "set.png", "go.png"]); + introAssets.set('school', [ + 'weeb/pixelUI/ready-pixel.png', + 'weeb/pixelUI/set-pixel.png', + 'weeb/pixelUI/date-pixel.png' + ]); + + var introAlts:Array = introAssets.get('default'); + + for (value in introAssets.keys()) + { + if (value == curStage) + introAlts = introAssets.get(value); + } + switch (swagCounter) + { case 0: FlxG.sound.play('assets/sounds/intro3' + TitleState.soundExt, 0.6); case 1: - var ready:FlxSprite = new FlxSprite().loadGraphic('assets/images/ready.png'); + var ready:FlxSprite = new FlxSprite().loadGraphic('assets/images/' + introAlts[0]); ready.scrollFactor.set(); + ready.updateHitbox(); + + if (curStage == 'school') + ready.setGraphicSize(Std.int(ready.width * daPixelZoom)); + ready.screenCenter(); add(ready); FlxTween.tween(ready, {y: ready.y += 100, alpha: 0}, Conductor.crochet / 1000, { @@ -624,8 +681,12 @@ class PlayState extends MusicBeatState }); FlxG.sound.play('assets/sounds/intro2' + TitleState.soundExt, 0.6); case 2: - var set:FlxSprite = new FlxSprite().loadGraphic('assets/images/set.png'); + var set:FlxSprite = new FlxSprite().loadGraphic('assets/images/' + introAlts[1]); set.scrollFactor.set(); + + if (curStage == 'school') + set.setGraphicSize(Std.int(set.width * daPixelZoom)); + set.screenCenter(); add(set); FlxTween.tween(set, {y: set.y += 100, alpha: 0}, Conductor.crochet / 1000, { @@ -637,8 +698,14 @@ class PlayState extends MusicBeatState }); FlxG.sound.play('assets/sounds/intro1' + TitleState.soundExt, 0.6); case 3: - var go:FlxSprite = new FlxSprite().loadGraphic('assets/images/go.png'); + var go:FlxSprite = new FlxSprite().loadGraphic('assets/images/' + introAlts[2]); go.scrollFactor.set(); + + if (curStage == 'school') + go.setGraphicSize(Std.int(go.width * daPixelZoom)); + + go.updateHitbox(); + go.screenCenter(); add(go); FlxTween.tween(go, {y: go.y += 100, alpha: 0}, Conductor.crochet / 1000, { @@ -780,19 +847,83 @@ class PlayState extends MusicBeatState { for (i in 0...4) { - FlxG.log.add(i); + // FlxG.log.add(i); var babyArrow:FlxSprite = new FlxSprite(0, strumLine.y); - var arrTex = FlxAtlasFrames.fromSparrow('assets/images/NOTE_assets.png', 'assets/images/NOTE_assets.xml'); - babyArrow.frames = arrTex; - babyArrow.animation.addByPrefix('green', 'arrowUP'); - babyArrow.animation.addByPrefix('blue', 'arrowDOWN'); - babyArrow.animation.addByPrefix('purple', 'arrowLEFT'); - babyArrow.animation.addByPrefix('red', 'arrowRIGHT'); - babyArrow.scrollFactor.set(); - babyArrow.setGraphicSize(Std.int(babyArrow.width * 0.7)); + switch (curStage) + { + case 'school': + babyArrow.loadGraphic('assets/images/weeb/pixelUI/arrows-pixels.png', true, 17, 17); + babyArrow.animation.add('green', [6]); + babyArrow.animation.add('red', [7]); + babyArrow.animation.add('blue', [5]); + babyArrow.animation.add('purplel', [4]); + + babyArrow.setGraphicSize(Std.int(babyArrow.width * daPixelZoom)); + babyArrow.updateHitbox(); + babyArrow.antialiasing = false; + + switch (Math.abs(i)) + { + case 2: + babyArrow.x += Note.swagWidth * 2; + babyArrow.animation.add('static', [2]); + babyArrow.animation.add('pressed', [6, 10], 12, false); + babyArrow.animation.add('confirm', [14, 18], 12, false); + case 3: + babyArrow.x += Note.swagWidth * 3; + babyArrow.animation.add('static', [3]); + babyArrow.animation.add('pressed', [7, 11], 12, false); + babyArrow.animation.add('confirm', [15, 19], 24, false); + case 1: + babyArrow.x += Note.swagWidth * 1; + babyArrow.animation.add('static', [1]); + babyArrow.animation.add('pressed', [5, 9], 12, false); + babyArrow.animation.add('confirm', [13, 17], 24, false); + case 0: + babyArrow.x += Note.swagWidth * 0; + babyArrow.animation.add('static', [0]); + babyArrow.animation.add('pressed', [4, 8], 12, false); + babyArrow.animation.add('confirm', [12, 16], 24, false); + } + + default: + babyArrow.frames = FlxAtlasFrames.fromSparrow('assets/images/NOTE_assets.png', 'assets/images/NOTE_assets.xml'); + babyArrow.animation.addByPrefix('green', 'arrowUP'); + babyArrow.animation.addByPrefix('blue', 'arrowDOWN'); + babyArrow.animation.addByPrefix('purple', 'arrowLEFT'); + babyArrow.animation.addByPrefix('red', 'arrowRIGHT'); + + babyArrow.antialiasing = true; + babyArrow.setGraphicSize(Std.int(babyArrow.width * 0.7)); + + switch (Math.abs(i)) + { + case 2: + babyArrow.x += Note.swagWidth * 2; + babyArrow.animation.addByPrefix('static', 'arrowUP'); + babyArrow.animation.addByPrefix('pressed', 'up press', 24, false); + babyArrow.animation.addByPrefix('confirm', 'up confirm', 24, false); + case 3: + babyArrow.x += Note.swagWidth * 3; + babyArrow.animation.addByPrefix('static', 'arrowRIGHT'); + babyArrow.animation.addByPrefix('pressed', 'right press', 24, false); + babyArrow.animation.addByPrefix('confirm', 'right confirm', 24, false); + case 1: + babyArrow.x += Note.swagWidth * 1; + babyArrow.animation.addByPrefix('static', 'arrowDOWN'); + babyArrow.animation.addByPrefix('pressed', 'down press', 24, false); + babyArrow.animation.addByPrefix('confirm', 'down confirm', 24, false); + case 0: + babyArrow.x += Note.swagWidth * 0; + babyArrow.animation.addByPrefix('static', 'arrowLEFT'); + babyArrow.animation.addByPrefix('pressed', 'left press', 24, false); + babyArrow.animation.addByPrefix('confirm', 'left confirm', 24, false); + } + } + babyArrow.updateHitbox(); - babyArrow.antialiasing = true; + babyArrow.scrollFactor.set(); babyArrow.y -= 10; babyArrow.alpha = 0; @@ -805,30 +936,6 @@ class PlayState extends MusicBeatState playerStrums.add(babyArrow); } - switch (Math.abs(i)) - { - case 2: - babyArrow.x += Note.swagWidth * 2; - babyArrow.animation.addByPrefix('static', 'arrowUP'); - babyArrow.animation.addByPrefix('pressed', 'up press', 24, false); - babyArrow.animation.addByPrefix('confirm', 'up confirm', 24, false); - case 3: - babyArrow.x += Note.swagWidth * 3; - babyArrow.animation.addByPrefix('static', 'arrowRIGHT'); - babyArrow.animation.addByPrefix('pressed', 'right press', 24, false); - babyArrow.animation.addByPrefix('confirm', 'right confirm', 24, false); - case 1: - babyArrow.x += Note.swagWidth * 1; - babyArrow.animation.addByPrefix('static', 'arrowDOWN'); - babyArrow.animation.addByPrefix('pressed', 'down press', 24, false); - babyArrow.animation.addByPrefix('confirm', 'down confirm', 24, false); - case 0: - babyArrow.x += Note.swagWidth * 0; - babyArrow.animation.addByPrefix('static', 'arrowLEFT'); - babyArrow.animation.addByPrefix('pressed', 'left press', 24, false); - babyArrow.animation.addByPrefix('confirm', 'left confirm', 24, false); - } - babyArrow.animation.play('static'); babyArrow.x += 50; babyArrow.x += ((FlxG.width / 2) * player); @@ -1069,7 +1176,6 @@ class PlayState extends MusicBeatState gfSpeed = 1; case 163: // FlxG.sound.music.stop(); - // curLevel = 'Bopeebo'; // FlxG.switchState(new TitleState()); } } @@ -1081,7 +1187,6 @@ class PlayState extends MusicBeatState case 128, 129, 130: vocals.volume = 0; // FlxG.sound.music.stop(); - // curLevel = 'Fresh'; // FlxG.switchState(new PlayState()); } } @@ -1591,7 +1696,7 @@ class PlayState extends MusicBeatState spr.animation.play('static'); } - if (spr.animation.curAnim.name == 'confirm') + if (spr.animation.curAnim.name == 'confirm' && curStage != 'school') { spr.centerOffsets(); spr.offset.x -= 13;