1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2024-12-28 07:56:46 +00:00

intro messages

This commit is contained in:
Cameron Taylor 2020-10-30 21:25:23 -07:00
parent 5a0dee6f63
commit 0fcd92f6d9
6 changed files with 199 additions and 12 deletions

View file

@ -94,5 +94,5 @@
<!--Place custom nodes like icons here (higher priority to override the HaxeFlixel icon)-->
<icon path="art/icon.png"/>
<haxedef name="SKIP_TO_PLAYSTATE" if="debug" />
<!-- <haxedef name="SKIP_TO_PLAYSTATE" if="debug" /> -->
</project>

View file

@ -18,6 +18,7 @@ import flixel.group.FlxGroup.FlxTypedGroup;
import flixel.group.FlxGroup;
import flixel.math.FlxMath;
import flixel.math.FlxPoint;
import flixel.system.FlxSound;
import flixel.text.FlxText;
import flixel.ui.FlxButton;
import flixel.ui.FlxSpriteButton;
@ -71,6 +72,8 @@ class ChartingState extends MusicBeatState
var tempBpm:Int = 0;
var vocals:FlxSound;
override function create()
{
gridBG = FlxGridOverlay.create(GRID_SIZE, GRID_SIZE, GRID_SIZE * 8, GRID_SIZE * 16);
@ -276,12 +279,24 @@ class ChartingState extends MusicBeatState
function loadSong(daSong:String):Void
{
if (FlxG.sound.music != null)
{
FlxG.sound.music.stop();
// vocals.stop();
}
FlxG.sound.playMusic('assets/music/' + daSong + "_Inst" + TitleState.soundExt, 0.6);
// WONT WORK FOR TUTORIAL! REDO LATER
vocals = new FlxSound().loadEmbedded("assets/music/" + daSong + "_Voices" + TitleState.soundExt);
FlxG.sound.list.add(vocals);
FlxG.sound.playMusic('assets/music/' + daSong + TitleState.soundExt, 0.6);
FlxG.sound.music.pause();
vocals.pause();
FlxG.sound.music.onComplete = function()
{
vocals.pause();
vocals.time = 0;
FlxG.sound.music.pause();
FlxG.sound.music.time = 0;
};
@ -430,6 +445,7 @@ class ChartingState extends MusicBeatState
{
PlayState.SONG = _song;
FlxG.sound.music.stop();
vocals.stop();
FlxG.switchState(new PlayState());
}
@ -440,9 +456,13 @@ class ChartingState extends MusicBeatState
if (FlxG.sound.music.playing)
{
FlxG.sound.music.pause();
vocals.pause();
}
else
{
vocals.play();
FlxG.sound.music.play();
}
}
if (FlxG.keys.justPressed.R)
@ -456,6 +476,7 @@ class ChartingState extends MusicBeatState
if (FlxG.keys.pressed.W || FlxG.keys.pressed.S)
{
FlxG.sound.music.pause();
vocals.pause();
var daTime:Float = 700 * FlxG.elapsed;
@ -465,6 +486,8 @@ class ChartingState extends MusicBeatState
}
else
FlxG.sound.music.time += daTime;
vocals.time = FlxG.sound.music.time;
}
}
@ -497,6 +520,7 @@ class ChartingState extends MusicBeatState
if (updateMusic)
{
FlxG.sound.music.pause();
vocals.pause();
var daNum:Int = 0;
var daLength:Int = 0;
@ -507,6 +531,7 @@ class ChartingState extends MusicBeatState
}
FlxG.sound.music.time = (daLength - (_song.notes[sec].lengthInSteps)) * Conductor.stepCrochet;
vocals.time = FlxG.sound.music.time;
updateCurStep();
}

148
source/MainMenuState.hx Normal file
View file

@ -0,0 +1,148 @@
package;
import flixel.FlxG;
import flixel.FlxObject;
import flixel.FlxSprite;
import flixel.effects.FlxFlicker;
import flixel.graphics.frames.FlxAtlasFrames;
import flixel.group.FlxGroup.FlxTypedGroup;
import flixel.tweens.FlxEase;
import flixel.tweens.FlxTween;
class MainMenuState extends MusicBeatState
{
var curSelected:Int = 0;
var menuItems:FlxTypedGroup<FlxSprite>;
var optionShit:Array<String> = ['story mode', 'freeplay', 'donate'];
var magenta:FlxSprite;
var camFollow:FlxObject;
override function create()
{
persistentUpdate = persistentDraw = true;
var bg:FlxSprite = new FlxSprite(-80).loadGraphic(AssetPaths.menuBG__png);
bg.scrollFactor.x = 0;
bg.scrollFactor.y = 0.18;
bg.setGraphicSize(Std.int(bg.width * 1.1));
bg.updateHitbox();
bg.screenCenter();
bg.antialiasing = true;
add(bg);
camFollow = new FlxObject(0, 0, 1, 1);
add(camFollow);
magenta = new FlxSprite().makeGraphic(FlxG.width, FlxG.height, 0xFFF44688);
magenta.visible = false;
add(magenta);
magenta.scrollFactor.set();
menuItems = new FlxTypedGroup<FlxSprite>();
add(menuItems);
var tex = FlxAtlasFrames.fromSparrow(AssetPaths.FNF_main_menu_assets__png, AssetPaths.FNF_main_menu_assets__xml);
for (i in 0...optionShit.length)
{
var menuItem:FlxSprite = new FlxSprite(0, 60 + (i * 160));
menuItem.frames = tex;
menuItem.animation.addByPrefix('idle', optionShit[i] + " basic", 24);
menuItem.animation.addByPrefix('selected', optionShit[i] + " white", 24);
menuItem.animation.play('idle');
menuItem.ID = i;
menuItem.screenCenter(X);
menuItems.add(menuItem);
menuItem.scrollFactor.set();
menuItem.antialiasing = true;
}
FlxG.camera.follow(camFollow, null, 0.06);
changeItem();
super.create();
}
override function update(elapsed:Float)
{
if (controls.UP_P)
changeItem(-1);
if (controls.DOWN_P)
changeItem(1);
super.update(elapsed);
if (controls.ACCEPT)
{
if (optionShit[curSelected] == 'donate')
{
FlxG.openURL('https://ninja-muffin24.itch.io/funkin');
}
else
{
FlxFlicker.flicker(magenta, 0, 0.40);
menuItems.forEach(function(spr:FlxSprite)
{
if (curSelected != spr.ID)
{
FlxTween.tween(spr, {alpha: 0}, 0.4, {
ease: FlxEase.quadOut,
onComplete: function(twn:FlxTween)
{
spr.kill();
}
});
}
else
{
FlxFlicker.flicker(spr, 1, 0.06, false, false, function(flick:FlxFlicker)
{
var daChoice:String = optionShit[curSelected];
switch (daChoice)
{
case 'story mode':
FlxG.switchState(new StoryMenuState());
case 'freeplay':
FlxG.switchState(new FreeplayState());
}
});
}
});
}
}
menuItems.forEach(function(spr:FlxSprite)
{
spr.screenCenter(X);
});
}
function changeItem(huh:Int = 0)
{
curSelected += huh;
if (curSelected >= menuItems.length)
curSelected = 0;
if (curSelected < 0)
curSelected = menuItems.length - 1;
menuItems.forEach(function(spr:FlxSprite)
{
spr.animation.play('idle');
if (spr.ID == curSelected)
{
spr.animation.play('selected');
camFollow.setPosition(spr.getGraphicMidpoint().x, spr.getGraphicMidpoint().y);
}
spr.updateHitbox();
});
}
}

View file

@ -728,6 +728,8 @@ class PlayState extends MusicBeatState
if (storyPlaylist.length <= 0)
{
FlxG.switchState(new TitleState());
StoryMenuState.weekUnlocked[1] = true;
}
else
{

View file

@ -15,7 +15,9 @@ class StoryMenuState extends MusicBeatState
var scoreText:FlxText;
var weekData:Array<Dynamic> = [['Tutorial', 'Bopeebo', 'Fresh', 'Dadbattle'], ['Spookeez', 'South', 'Monster']];
var weekUnlocked:Array<Bool> = [true, false];
public static var weekUnlocked:Array<Bool> = [true, false];
var weekCharacters:Array<Dynamic> = [['dad', 'bf', 'gf'], ['spooky', 'bf', 'gf']];
var curWeek:Int = 0;

View file

@ -28,6 +28,14 @@ class TitleState extends MusicBeatState
var credTextShit:Alphabet;
var textGroup:FlxGroup;
var wackyIntros:Array<Array<String>> = [
['Shoutouts to tom fulp', 'lmao'], ["Ludum dare", "extraordinaire"], ['Cyberzone', 'coming soon'], ['love to thriftman', 'swag'],
['ULTIMATE RHYTHM GAMING', 'probably'], ['DOPE ASS GAME', 'playstation magazine'], ['in loving memory of', 'henryeyes'], ['dancin', 'forever'],
['Ritz dx', 'rest in peace'], ['rate five', 'do not blam'], ['rhythm gaming', 'ultimate'], ['game of the year', 'forever'],
['you already know', 'we really out here'], ['rise and grind', 'love to luis'], ['like parappa', 'but cooler']];
var curWacky:Array<String> = [];
override public function create():Void
{
#if (!web)
@ -36,12 +44,14 @@ class TitleState extends MusicBeatState
PlayerSettings.init();
curWacky = FlxG.random.getObject(wackyIntros);
// DEBUG BULLSHIT
super.create();
#if SKIP_TO_PLAYSTATE
FlxG.switchState(new FreeplayState());
FlxG.switchState(new MainMenuState());
#else
startIntro();
#end
@ -55,9 +65,9 @@ class TitleState extends MusicBeatState
diamond.persist = true;
diamond.destroyOnNoUse = false;
FlxTransitionableState.defaultTransIn = new TransitionData(FADE, FlxColor.BLACK, 2, new FlxPoint(0, -1), {asset: diamond, width: 32, height: 32},
FlxTransitionableState.defaultTransIn = new TransitionData(FADE, FlxColor.BLACK, 1, new FlxPoint(0, -1), {asset: diamond, width: 32, height: 32},
new FlxRect(0, 0, FlxG.width, FlxG.height));
FlxTransitionableState.defaultTransOut = new TransitionData(FADE, FlxColor.BLACK, 1.3, new FlxPoint(0, 1),
FlxTransitionableState.defaultTransOut = new TransitionData(FADE, FlxColor.BLACK, 0.7, new FlxPoint(0, 1),
{asset: diamond, width: 32, height: 32}, new FlxRect(0, 0, FlxG.width, FlxG.height));
initialized = true;
@ -108,7 +118,7 @@ class TitleState extends MusicBeatState
// credGroup.add(credTextShit);
FlxG.sound.playMusic('assets/music/freakyMenu' + TitleState.soundExt, 0, false);
FlxG.sound.playMusic('assets/music/freakyMenu' + TitleState.soundExt, 0);
FlxG.sound.music.fadeIn(4, 0, 0.7);
}
@ -139,13 +149,13 @@ class TitleState extends MusicBeatState
FlxG.camera.flash(FlxColor.WHITE, 1);
transitioning = true;
FlxG.sound.music.stop();
// FlxG.sound.music.stop();
new FlxTimer().start(2, function(tmr:FlxTimer)
{
FlxG.switchState(new StoryMenuState());
FlxG.switchState(new MainMenuState());
});
FlxG.sound.play('assets/music/titleShoot' + TitleState.soundExt, 0.7);
// FlxG.sound.play('assets/music/titleShoot' + TitleState.soundExt, 0.7);
}
super.update(elapsed);
@ -213,10 +223,10 @@ class TitleState extends MusicBeatState
// credTextShit.text = 'Shoutouts Tom Fulp';
// credTextShit.screenCenter();
case 9:
createCoolText(['Shoutouts Tom Fulp']);
createCoolText([curWacky[0]]);
// credTextShit.visible = true;
case 11:
addMoreText('lmao');
addMoreText(curWacky[1]);
// credTextShit.text += '\nlmao';
case 12:
deleteCoolText();