1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2024-11-09 00:04:42 +00:00

Merge branch 'nitpix'

This commit is contained in:
Cameron Taylor 2021-03-18 16:22:53 -04:00
commit dc3098c3e1
8 changed files with 168 additions and 127 deletions

View file

@ -410,8 +410,8 @@ class Character extends FlxSprite
animation.play('firstDeath');
addOffset('firstDeath');
addOffset('deathLoop', -37);
addOffset('deathConfirm', -37);
addOffset('deathLoop', -30, -12);
addOffset('deathConfirm', -30, -12);
playAnim('firstDeath');
// pixel bullshit
setGraphicSize(Std.int(width * 6));

View file

@ -60,6 +60,24 @@ class DialogueBox extends FlxSpriteGroup
bgFade.alpha = 0.7;
}, 5);
portraitLeft = new FlxSprite(-20, 40);
portraitLeft.frames = Paths.getSparrowAtlas('weeb/senpaiPortrait');
portraitLeft.animation.addByPrefix('enter', 'Senpai Portrait Enter', 24, false);
portraitLeft.setGraphicSize(Std.int(portraitLeft.width * PlayState.daPixelZoom * 0.9));
portraitLeft.updateHitbox();
portraitLeft.scrollFactor.set();
add(portraitLeft);
portraitLeft.visible = false;
portraitRight = new FlxSprite(0, 40);
portraitRight.frames = Paths.getSparrowAtlas('weeb/bfPortrait');
portraitRight.animation.addByPrefix('enter', 'Boyfriend portrait enter', 24, false);
portraitRight.setGraphicSize(Std.int(portraitRight.width * PlayState.daPixelZoom * 0.9));
portraitRight.updateHitbox();
portraitRight.scrollFactor.set();
add(portraitRight);
portraitRight.visible = false;
box = new FlxSprite(-20, 45);
var hasDialog = false;
@ -94,24 +112,6 @@ class DialogueBox extends FlxSpriteGroup
if (!hasDialog)
return;
portraitLeft = new FlxSprite(-20, 40);
portraitLeft.frames = Paths.getSparrowAtlas('weeb/senpaiPortrait');
portraitLeft.animation.addByPrefix('enter', 'Senpai Portrait Enter', 24, false);
portraitLeft.setGraphicSize(Std.int(portraitLeft.width * PlayState.daPixelZoom * 0.9));
portraitLeft.updateHitbox();
portraitLeft.scrollFactor.set();
add(portraitLeft);
portraitLeft.visible = false;
portraitRight = new FlxSprite(0, 40);
portraitRight.frames = Paths.getSparrowAtlas('weeb/bfPortrait');
portraitRight.animation.addByPrefix('enter', 'Boyfriend portrait enter', 24, false);
portraitRight.setGraphicSize(Std.int(portraitRight.width * PlayState.daPixelZoom * 0.9));
portraitRight.updateHitbox();
portraitRight.scrollFactor.set();
add(portraitRight);
portraitRight.visible = false;
box.animation.play('normalOpen');
box.setGraphicSize(Std.int(box.width * PlayState.daPixelZoom * 0.9));
box.updateHitbox();
@ -120,7 +120,10 @@ class DialogueBox extends FlxSpriteGroup
box.screenCenter(X);
portraitLeft.screenCenter(X);
handSelect = new FlxSprite(FlxG.width * 0.9, FlxG.height * 0.9).loadGraphic(Paths.image('weeb/pixelUI/hand_textbox'));
handSelect = new FlxSprite(1042, 590).loadGraphic(Paths.image('weeb/pixelUI/hand_textbox'));
handSelect.setGraphicSize(Std.int(handSelect.width * PlayState.daPixelZoom * 0.9));
handSelect.updateHitbox();
handSelect.visible = false;
add(handSelect);
@ -199,6 +202,7 @@ class DialogueBox extends FlxSpriteGroup
portraitLeft.visible = false;
portraitRight.visible = false;
swagDialogue.alpha -= 1 / 5;
handSelect.alpha -= 1 / 5;
dropText.alpha = swagDialogue.alpha;
}, 5);
@ -230,7 +234,13 @@ class DialogueBox extends FlxSpriteGroup
// swagDialogue.text = ;
swagDialogue.resetText(dialogueList[0]);
swagDialogue.start(0.04, true);
swagDialogue.start(0.04);
swagDialogue.completeCallback = function()
{
trace("dialogue finish");
handSelect.visible = true;
};
handSelect.visible = false;
switch (curCharacter)
{

View file

@ -59,7 +59,7 @@ class FreeplayState extends MusicBeatState
addWeek(['Bopeebo', 'Fresh', 'Dadbattle'], 1, ['dad']);
if (StoryMenuState.weekUnlocked[2] || isDebug)
addWeek(['Spookeez', 'South', 'Monster'], 2, ['spooky']);
addWeek(['Spookeez', 'South', 'Monster'], 2, ['spooky', 'spooky', 'monster']);
if (StoryMenuState.weekUnlocked[3] || isDebug)
addWeek(['Pico', 'Philly', 'Blammed'], 3, ['pico']);

View file

@ -45,7 +45,7 @@ class MainMenuState extends MusicBeatState
var bg:FlxSprite = new FlxSprite(-80).loadGraphic(Paths.image('menuBG'));
bg.scrollFactor.x = 0;
bg.scrollFactor.y = 0.18;
bg.scrollFactor.y = 0.17;
bg.setGraphicSize(Std.int(bg.width * 1.1));
bg.updateHitbox();
bg.screenCenter();
@ -57,7 +57,7 @@ class MainMenuState extends MusicBeatState
magenta = new FlxSprite(-80).loadGraphic(Paths.image('menuDesat'));
magenta.scrollFactor.x = 0;
magenta.scrollFactor.y = 0.18;
magenta.scrollFactor.y = 0.17;
magenta.setGraphicSize(Std.int(magenta.width * 1.1));
magenta.updateHitbox();
magenta.screenCenter();
@ -208,11 +208,25 @@ class MainMenuState extends MusicBeatState
if (spr.ID == curSelected)
{
spr.animation.play('selected');
camFollow.setPosition(spr.getGraphicMidpoint().x, spr.getGraphicMidpoint().y);
spr.animation.play('selected');
}
spr.updateHitbox();
if(spr.animation.curAnim.name == 'selected')
{
switch(optionShit[curSelected])
{
case 'story mode':
spr.offset.y += 26;
case 'freeplay':
spr.offset.y += 28;
case 'donate':
spr.offset.y += 21;
case 'options':
spr.offset.y += 26;
}
}
});
}
}

View file

@ -9,9 +9,6 @@ import flixel.util.FlxTimer;
class MusicBeatState extends FlxUIState
{
private var lastBeat:Float = 0;
private var lastStep:Float = 0;
private var curStep:Int = 0;
private var curBeat:Int = 0;
private var controls(get, never):Controls;
@ -35,7 +32,7 @@ class MusicBeatState extends FlxUIState
updateCurStep();
updateBeat();
if (oldStep != curStep && curStep > 0)
if (oldStep != curStep && curStep >= 0)
stepHit();
super.update(elapsed);

View file

@ -11,9 +11,6 @@ class MusicBeatSubstate extends FlxSubState
super();
}
private var lastBeat:Float = 0;
private var lastStep:Float = 0;
private var curStep:Int = 0;
private var curBeat:Int = 0;
private var controls(get, never):Controls;
@ -29,7 +26,7 @@ class MusicBeatSubstate extends FlxSubState
updateCurStep();
curBeat = Math.floor(curStep / 4);
if (oldStep != curStep && curStep > 0)
if (oldStep != curStep && curStep >= 0)
stepHit();

View file

@ -919,9 +919,18 @@ class PlayState extends MusicBeatState
startTimer = new FlxTimer().start(Conductor.crochet / 1000, function(tmr:FlxTimer)
{
dad.dance();
gf.dance();
boyfriend.playAnim('idle');
// this just based on beatHit stuff but compact
if (swagCounter % gfSpeed == 0)
gf.dance();
if (swagCounter % 2 == 0)
{
if (!boyfriend.animation.curAnim.name.startsWith("sing"))
boyfriend.playAnim('idle');
if (!dad.animation.curAnim.name.startsWith("sing"))
dad.dance();
}
else if (dad.curCharacter == 'spooky' && !dad.animation.curAnim.name.startsWith("sing"))
dad.dance();
var introAssets:Map<String, Array<String>> = new Map<String, Array<String>>();
introAssets.set('default', ['ready', "set", "go"]);
@ -1297,6 +1306,39 @@ class PlayState extends MusicBeatState
iconP1.animation.play('bf-old');
}
// do this BEFORE super.update() so songPosition is accurate
if (startingSong)
{
if (startedCountdown)
{
Conductor.songPosition += FlxG.elapsed * 1000;
if (Conductor.songPosition >= 0)
startSong();
}
}
else
{
// Conductor.songPosition = FlxG.sound.music.time;
Conductor.songPosition += FlxG.elapsed * 1000;
if (!paused)
{
songTime += FlxG.game.ticks - previousFrameTime;
previousFrameTime = FlxG.game.ticks;
// Interpolation type beat
if (Conductor.lastSongPos != Conductor.songPosition)
{
songTime = (songTime + Conductor.songPosition) / 2;
Conductor.lastSongPos = Conductor.songPosition;
// Conductor.songPosition += FlxG.elapsed * 1000;
// trace('MISSED FRAME');
}
}
// Conductor.lastSongPos = FlxG.sound.music.time;
}
switch (curStage)
{
case 'philly':
@ -1317,7 +1359,7 @@ class PlayState extends MusicBeatState
scoreTxt.text = "Score:" + songScore;
if (FlxG.keys.justPressed.ENTER && startedCountdown && canPause)
if (controls.PAUSE && startedCountdown && canPause)
{
persistentUpdate = false;
persistentDraw = true;
@ -1373,38 +1415,6 @@ class PlayState extends MusicBeatState
FlxG.switchState(new AnimationDebug(SONG.player2));
#end
if (startingSong)
{
if (startedCountdown)
{
Conductor.songPosition += FlxG.elapsed * 1000;
if (Conductor.songPosition >= 0)
startSong();
}
}
else
{
// Conductor.songPosition = FlxG.sound.music.time;
Conductor.songPosition += FlxG.elapsed * 1000;
if (!paused)
{
songTime += FlxG.game.ticks - previousFrameTime;
previousFrameTime = FlxG.game.ticks;
// Interpolation type beat
if (Conductor.lastSongPos != Conductor.songPosition)
{
songTime = (songTime + Conductor.songPosition) / 2;
Conductor.lastSongPos = Conductor.songPosition;
// Conductor.songPosition += FlxG.elapsed * 1000;
// trace('MISSED FRAME');
}
}
// Conductor.lastSongPos = FlxG.sound.music.time;
}
if (generatedMusic && PlayState.SONG.notes[Std.int(curStep / 16)] != null)
{
if (curBeat % 4 == 0)
@ -2219,8 +2229,7 @@ class PlayState extends MusicBeatState
function trainStart():Void
{
trainMoving = true;
if (!trainSound.playing)
trainSound.play(true);
trainSound.play(true);
}
var startedMoving:Bool = false;
@ -2310,10 +2319,6 @@ class PlayState extends MusicBeatState
}
// else
// Conductor.changeBPM(SONG.bpm);
// Dad doesnt interupt his own notes
if (SONG.notes[Math.floor(curStep / 16)].mustHitSection)
dad.dance();
}
// FlxG.log.add('change bpm' + SONG.notes[Std.int(curStep / 16)].changeBPM);
wiggleShit.update(Conductor.crochet);
@ -2342,9 +2347,17 @@ class PlayState extends MusicBeatState
gf.dance();
}
if (!boyfriend.animation.curAnim.name.startsWith("sing"))
if (curBeat % 2 == 0)
{
boyfriend.playAnim('idle');
if (!boyfriend.animation.curAnim.name.startsWith("sing"))
boyfriend.playAnim('idle');
if (!dad.animation.curAnim.name.startsWith("sing"))
dad.dance();
}
else if (dad.curCharacter == 'spooky')
{
if (!dad.animation.curAnim.name.startsWith("sing"))
dad.dance();
}
if (curBeat % 8 == 7 && curSong == 'Bopeebo')

View file

@ -34,6 +34,8 @@ class TitleState extends MusicBeatState
var wackyImage:FlxSprite;
var lastBeat:Int = 0;
override public function create():Void
{
#if polymod
@ -304,7 +306,7 @@ class TitleState extends MusicBeatState
// FlxG.sound.play(Paths.music('titleShoot'), 0.7);
}
if (pressedEnter && !skippedIntro)
if (pressedEnter && !skippedIntro && initialized)
{
skipIntro();
}
@ -346,7 +348,7 @@ class TitleState extends MusicBeatState
{
super.beatHit();
logoBl.animation.play('bump');
logoBl.animation.play('bump', true);
danceLeft = !danceLeft;
if (danceLeft)
@ -355,57 +357,65 @@ class TitleState extends MusicBeatState
gfDance.animation.play('danceLeft');
FlxG.log.add(curBeat);
switch (curBeat)
// if the user is draggin the window some beats will
// be missed so this is just to compensate
if (curBeat > lastBeat)
{
case 1:
createCoolText(['ninjamuffin99', 'phantomArcade', 'kawaisprite', 'evilsk8er']);
// credTextShit.visible = true;
case 3:
addMoreText('present');
// credTextShit.text += '\npresent...';
// credTextShit.addText();
case 4:
deleteCoolText();
// credTextShit.visible = false;
// credTextShit.text = 'In association \nwith';
// credTextShit.screenCenter();
case 5:
createCoolText(['In association', 'with']);
case 7:
addMoreText('newgrounds');
ngSpr.visible = true;
// credTextShit.text += '\nNewgrounds';
case 8:
deleteCoolText();
ngSpr.visible = false;
// credTextShit.visible = false;
for (i in lastBeat...curBeat)
{
switch (i + 1)
{
case 1:
createCoolText(['ninjamuffin99', 'phantomArcade', 'kawaisprite', 'evilsk8er']);
// credTextShit.visible = true;
case 3:
addMoreText('present');
// credTextShit.text += '\npresent...';
// credTextShit.addText();
case 4:
deleteCoolText();
// credTextShit.visible = false;
// credTextShit.text = 'In association \nwith';
// credTextShit.screenCenter();
case 5:
createCoolText(['In association', 'with']);
case 7:
addMoreText('newgrounds');
ngSpr.visible = true;
// credTextShit.text += '\nNewgrounds';
case 8:
deleteCoolText();
ngSpr.visible = false;
// credTextShit.visible = false;
// credTextShit.text = 'Shoutouts Tom Fulp';
// credTextShit.screenCenter();
case 9:
createCoolText([curWacky[0]]);
// credTextShit.visible = true;
case 11:
addMoreText(curWacky[1]);
// credTextShit.text += '\nlmao';
case 12:
deleteCoolText();
// credTextShit.visible = false;
// credTextShit.text = "Friday";
// credTextShit.screenCenter();
case 13:
addMoreText('Friday');
// credTextShit.visible = true;
case 14:
addMoreText('Night');
// credTextShit.text += '\nNight';
case 15:
addMoreText('Funkin'); // credTextShit.text += '\nFunkin';
// credTextShit.text = 'Shoutouts Tom Fulp';
// credTextShit.screenCenter();
case 9:
createCoolText([curWacky[0]]);
// credTextShit.visible = true;
case 11:
addMoreText(curWacky[1]);
// credTextShit.text += '\nlmao';
case 12:
deleteCoolText();
// credTextShit.visible = false;
// credTextShit.text = "Friday";
// credTextShit.screenCenter();
case 13:
addMoreText('Friday');
// credTextShit.visible = true;
case 14:
addMoreText('Night');
// credTextShit.text += '\nNight';
case 15:
addMoreText('Funkin'); // credTextShit.text += '\nFunkin';
case 16:
skipIntro();
case 16:
skipIntro();
}
}
}
lastBeat = curBeat;
}
var skippedIntro:Bool = false;