1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2024-09-12 05:07:06 +00:00

Merge branch 'master' into options

This commit is contained in:
George FunBook 2021-03-13 22:41:29 -06:00
commit 9ffa28dd21
16 changed files with 910 additions and 384 deletions

View file

@ -5,8 +5,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
### Added
- TANKMAN! 3 NEW SONGS BY KAWAISPRITE (UGH, GUNS, STRESS)! Charting help by MtH!
- Monster added into week 2, FINALLY (Charting help by MtH and ChaoticGamer!)
- Can now change song difficulty mid-game.
- Shows some song info on pause screen.
- Cute little icons onto freeplay menu
### Changed
- ASSET LOADING OVERHAUL, WAY FASTER LOAD TIMES ON WEB!!! (THANKS TO GEOKURELI WOKE KING)
- Made difficulty selector on freeplay menu more apparent
### Fixed
- That one random note on Bopeebo

View file

@ -40,6 +40,8 @@
<classpath name="source" />
<assets path='assets/preload/music' include="*mp4" embed='false' />
<assets path="assets/preload" rename="assets" exclude="*.ogg" if="web"/>
<assets path="assets/preload" rename="assets" exclude="*.mp3" unless="web"/>
@ -57,6 +59,7 @@
<library name="week4" preload="true" />
<library name="week5" preload="true" />
<library name="week6" preload="true" />
<library name="week7" preload="true" />
</section>
<section if="NO_PRELOAD_ALL">
@ -69,6 +72,7 @@
<library name="week4" preload="false" />
<library name="week5" preload="false" />
<library name="week6" preload="false" />
<library name="week7" preload="false" />
</section>
<assets path="assets/songs" library="songs" exclude="*.fla|*.ogg" if="web"/>
@ -89,8 +93,13 @@
<assets path="assets/week5" library="week5" exclude="*.fla|*.mp3" unless="web"/>
<assets path="assets/week6" library="week6" exclude="*.fla|*.ogg" if="web"/>
<assets path="assets/week6" library="week6" exclude="*.fla|*.mp3" unless="web"/>
<assets path="assets/week7" library="week7" exclude="*.fla|*.ogg" if="web"/>
<assets path="assets/week7" library="week7" exclude="*.fla|*.mp3" unless="web"/>
<assets path='example_mods' rename='mods' embed='false'/>
<!-- <assets path='example_mods' rename='mods' embed='false'/> -->
<template path="example_mods" rename="mods" />
<assets path='art/readme.txt' rename='do NOT readme.txt' />
<!-- <template path='mods' /> -->

View file

@ -0,0 +1 @@
awesomes tream--really awesome

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 MiB

View file

@ -8,6 +8,11 @@ import flixel.addons.display.FlxGridOverlay;
import flixel.group.FlxGroup.FlxTypedGroup;
import flixel.text.FlxText;
import flixel.util.FlxColor;
import openfl.events.Event;
import openfl.events.IOErrorEvent;
import openfl.net.FileReference;
using StringTools;
/**
*DEBUG MODE
@ -190,6 +195,65 @@ class AnimationDebug extends FlxState
char.playAnim(animList[curAnim]);
}
if (FlxG.keys.justPressed.ESCAPE)
{
var outputString:String = "";
for (swagAnim in animList)
{
outputString += swagAnim + " " + char.animOffsets.get(swagAnim)[0] + " " + char.animOffsets.get(swagAnim)[1] + "\n";
}
outputString.trim();
saveOffsets(outputString);
}
super.update(elapsed);
}
var _file:FileReference;
private function saveOffsets(saveString:String)
{
if ((saveString != null) && (saveString.length > 0))
{
_file = new FileReference();
_file.addEventListener(Event.COMPLETE, onSaveComplete);
_file.addEventListener(Event.CANCEL, onSaveCancel);
_file.addEventListener(IOErrorEvent.IO_ERROR, onSaveError);
_file.save(saveString, daAnim + "Offsets.txt");
}
}
function onSaveComplete(_):Void
{
_file.removeEventListener(Event.COMPLETE, onSaveComplete);
_file.removeEventListener(Event.CANCEL, onSaveCancel);
_file.removeEventListener(IOErrorEvent.IO_ERROR, onSaveError);
_file = null;
FlxG.log.notice("Successfully saved LEVEL DATA.");
}
/**
* Called when the save file dialog is cancelled.
*/
function onSaveCancel(_):Void
{
_file.removeEventListener(Event.COMPLETE, onSaveComplete);
_file.removeEventListener(Event.CANCEL, onSaveCancel);
_file.removeEventListener(IOErrorEvent.IO_ERROR, onSaveError);
_file = null;
}
/**
* Called if there is an error while saving the gameplay recording.
*/
function onSaveError(_):Void
{
_file.removeEventListener(Event.COMPLETE, onSaveComplete);
_file.removeEventListener(Event.CANCEL, onSaveCancel);
_file.removeEventListener(IOErrorEvent.IO_ERROR, onSaveError);
_file = null;
FlxG.log.error("Problem saving Level data");
}
}

43
source/BGSprite.hx Normal file
View file

@ -0,0 +1,43 @@
package;
import flixel.FlxSprite;
class BGSprite extends FlxSprite
{
/**
Cool lil utility thing just so that it can easy do antialiasing and scrollfactor bullshit
*/
public var idleAnim:String;
public function new(image:String, x:Float = 0, y:Float = 0, parX:Float = 1, parY:Float = 1, ?daAnimations:Array<String>)
{
super(x, y);
if (daAnimations != null)
{
frames = Paths.getSparrowAtlas(image);
for (anims in daAnimations)
{
animation.addByPrefix(anims, anims, 24, false);
animation.play(anims);
if (idleAnim == null)
idleAnim = anims;
}
}
else
{
loadGraphic(Paths.image(image));
active = false;
}
scrollFactor.set(parX, parY);
antialiasing = true;
}
public function dance():Void
{
if (idleAnim != null)
animation.play(idleAnim);
}
}

View file

@ -4,6 +4,7 @@ import flixel.FlxG;
import flixel.FlxSprite;
import flixel.animation.FlxBaseAnimation;
import flixel.graphics.frames.FlxAtlasFrames;
import haxe.io.Path;
using StringTools;
@ -47,7 +48,7 @@ class Character extends FlxSprite
animation.addByPrefix('scared', 'GF FEAR', 24);
addOffset('cheer');
addOffset('sad', -2, -2);
addOffset('sad', -2, -21);
addOffset('danceLeft', 0, -9);
addOffset('danceRight', 0, -9);
@ -78,7 +79,7 @@ class Character extends FlxSprite
animation.addByPrefix('scared', 'GF FEAR', 24);
addOffset('cheer');
addOffset('sad', -2, -2);
addOffset('sad', -2, -21);
addOffset('danceLeft', 0, -9);
addOffset('danceRight', 0, -9);
@ -207,10 +208,10 @@ class Character extends FlxSprite
animation.addByPrefix('singRIGHT', 'Monster Right note', 24, false);
addOffset('idle');
addOffset("singUP", -20, 50);
addOffset("singRIGHT", -51);
addOffset("singLEFT", -30);
addOffset("singDOWN", -30, -40);
addOffset("singUP", -20, 94);
addOffset("singRIGHT", -51, 30);
addOffset("singLEFT", -30, 20);
addOffset("singDOWN", -50, -80);
playAnim('idle');
case 'monster-christmas':
tex = Paths.getSparrowAtlas('christmas/monsterChristmas');
@ -266,6 +267,18 @@ class Character extends FlxSprite
flipX = true;
case 'pico-speaker':
frames = Paths.getSparrowAtlas('characters/picoSpeaker');
quickAnimAdd('shoot1', "Pico shoot 1");
quickAnimAdd('shoot2', "Pico shoot 2");
quickAnimAdd('shoot3', "Pico shoot 3");
quickAnimAdd('shoot4', "Pico shoot 4");
// here for now, will be replaced later for less copypaste
loadOffsetFile(curCharacter);
playAnim('shoot1');
case 'bf':
var tex = Paths.getSparrowAtlas('BOYFRIEND');
frames = tex;
@ -495,6 +508,37 @@ class Character extends FlxSprite
addOffset("singDOWN-alt", -30, -27);
playAnim('idle');
case 'tankman':
frames = Paths.getSparrowAtlas('characters/tankmanCaptain');
animation.addByPrefix('idle', "Tankman Idle Dance", 24, false);
if (isPlayer)
{
animation.addByPrefix('singLEFT', 'Tankman Note Left0', 24, false);
animation.addByPrefix('singRIGHT', 'Tankman Right Note0', 24, false);
animation.addByPrefix('singLEFTmiss', 'Tankman Note Left MISS', 24, false);
animation.addByPrefix('singRIGHTmiss', 'Tankman Right Note MISS', 24, false);
}
else
{
// Need to be flipped! REDO THIS LATER
animation.addByPrefix('singLEFT', 'Tankman Right Note0', 24, false);
animation.addByPrefix('singRIGHT', 'Tankman Note Left0', 24, false);
animation.addByPrefix('singLEFTmiss', 'Tankman Right Note MISS', 24, false);
animation.addByPrefix('singRIGHTmiss', 'Tankman Note Left MISS', 24, false);
}
animation.addByPrefix('singUP', 'Tankman UP note0', 24, false);
animation.addByPrefix('singDOWN', 'Tankman DOWN note0', 24, false);
animation.addByPrefix('singUPmiss', 'Tankman UP note MISS', 24, false);
animation.addByPrefix('singDOWNmiss', 'Tankman DOWN note MISS', 24, false);
loadOffsetFile(curCharacter);
playAnim('idle');
flipX = true;
}
dance();
@ -522,6 +566,22 @@ class Character extends FlxSprite
}
}
function quickAnimAdd(name:String, prefix:String)
{
animation.addByPrefix(name, prefix, 24, false);
}
private function loadOffsetFile(offsetCharacter:String)
{
var daFile:Array<String> = CoolUtil.coolTextFile(Paths.file("images/characters/" + offsetCharacter + "Offsets.txt"));
for (i in daFile)
{
var splitWords:Array<String> = i.split(" ");
addOffset(splitWords[0], Std.parseInt(splitWords[1]), Std.parseInt(splitWords[2]));
}
}
override function update(elapsed:Float)
{
if (!curCharacter.startsWith('bf'))
@ -605,6 +665,8 @@ class Character extends FlxSprite
else
playAnim('danceLeft');
}
case 'pico-speaker':
playAnim('shoot' + FlxG.random.int(1, 4), true);
case 'spooky':
danced = !danced;

View file

@ -7,6 +7,7 @@ import flixel.addons.display.FlxGridOverlay;
import flixel.group.FlxGroup.FlxTypedGroup;
import flixel.math.FlxMath;
import flixel.text.FlxText;
import flixel.tweens.FlxTween;
import flixel.util.FlxColor;
import lime.utils.Assets;
@ -25,10 +26,13 @@ class FreeplayState extends MusicBeatState
var lerpScore:Int = 0;
var intendedScore:Int = 0;
var coolColors:Array<Int> = [0xff223344, 0xff123456, 0xFFFFFFFF, 0xFFADAD];
private var grpSongs:FlxTypedGroup<Alphabet>;
private var curPlaying:Bool = false;
private var iconArray:Array<HealthIcon> = [];
var bg:FlxSprite;
override function create()
{
@ -39,13 +43,11 @@ class FreeplayState extends MusicBeatState
songs.push(new SongMetadata(initSonglist[i], 1, 'gf'));
}
/*
if (FlxG.sound.music != null)
{
if (!FlxG.sound.music.playing)
FlxG.sound.playMusic(Paths.music('freakyMenu'));
}
*/
if (FlxG.sound.music != null)
{
if (!FlxG.sound.music.playing)
FlxG.sound.playMusic(Paths.music('freakyMenu'));
}
var isDebug:Bool = false;
@ -71,11 +73,14 @@ class FreeplayState extends MusicBeatState
if (StoryMenuState.weekUnlocked[6] || isDebug)
addWeek(['Senpai', 'Roses', 'Thorns'], 6, ['senpai', 'senpai', 'spirit']);
if (StoryMenuState.weekUnlocked[7] || isDebug)
addWeek(['Ugh', 'Guns', 'Stress'], 7, ['tankman']);
// LOAD MUSIC
// LOAD CHARACTERS
var bg:FlxSprite = new FlxSprite().loadGraphic(Paths.image('menuBGBlue'));
bg = new FlxSprite().loadGraphic(Paths.image('menuDesat'));
add(bg);
grpSongs = new FlxTypedGroup<Alphabet>();
@ -105,7 +110,7 @@ class FreeplayState extends MusicBeatState
scoreText.setFormat(Paths.font("vcr.ttf"), 32, FlxColor.WHITE, RIGHT);
// scoreText.alignment = RIGHT;
var scoreBG:FlxSprite = new FlxSprite(scoreText.x - 6, 0).makeGraphic(Std.int(FlxG.width * 0.35), 66, 0xFF000000);
var scoreBG:FlxSprite = new FlxSprite(scoreText.x - 6, 0).makeGraphic(Std.int(FlxG.width * 0.3), 66, 0xFF000000);
scoreBG.alpha = 0.6;
add(scoreBG);
@ -172,12 +177,16 @@ class FreeplayState extends MusicBeatState
{
super.update(elapsed);
if (FlxG.sound.music.volume < 0.7)
if (FlxG.sound.music != null)
{
FlxG.sound.music.volume += 0.5 * FlxG.elapsed;
if (FlxG.sound.music.volume < 0.7)
{
FlxG.sound.music.volume += 0.5 * FlxG.elapsed;
}
}
lerpScore = Math.floor(FlxMath.lerp(lerpScore, intendedScore, 0.4));
bg.color = FlxColor.interpolate(bg.color, coolColors[curSelected % coolColors.length], 0.045);
if (Math.abs(lerpScore - intendedScore) <= 10)
lerpScore = intendedScore;
@ -210,9 +219,6 @@ class FreeplayState extends MusicBeatState
if (accepted)
{
var poop:String = Highscore.formatSong(songs[curSelected].songName.toLowerCase(), curDifficulty);
trace(poop);
PlayState.SONG = Song.loadFromJson(poop, songs[curSelected].songName.toLowerCase());
PlayState.isStoryMode = false;
PlayState.storyDifficulty = curDifficulty;
@ -234,15 +240,11 @@ class FreeplayState extends MusicBeatState
intendedScore = Highscore.getScore(songs[curSelected].songName, curDifficulty);
switch (curDifficulty)
{
case 0:
diffText.text = "EASY";
case 1:
diffText.text = 'NORMAL';
case 2:
diffText.text = "HARD";
}
PlayState.storyDifficulty = curDifficulty;
diffText.text = "< " + CoolUtil.difficultyString() + " >";
diffText.x = FlxG.width * 0.85;
diffText.x -= (diffText.width / 2);
}
function changeSelection(change:Int = 0)

View file

@ -21,6 +21,7 @@ class HealthIcon extends FlxSprite
animation.add('bf-pixel', [21, 21], 0, false, isPlayer);
animation.add('spooky', [2, 3], 0, false, isPlayer);
animation.add('pico', [4, 5], 0, false, isPlayer);
animation.add('pico-speaker', [4, 5], 0, false, isPlayer);
animation.add('mom', [6, 7], 0, false, isPlayer);
animation.add('mom-car', [6, 7], 0, false, isPlayer);
animation.add('tankman', [8, 9], 0, false, isPlayer);

View file

@ -1,39 +1,37 @@
package;
import lime.app.Promise;
import lime.app.Future;
import flixel.FlxG;
import flixel.FlxState;
import flixel.FlxSprite;
import flixel.FlxState;
import flixel.graphics.frames.FlxAtlasFrames;
import flixel.util.FlxTimer;
import openfl.utils.Assets;
import lime.utils.Assets as LimeAssets;
import haxe.io.Path;
import lime.app.Future;
import lime.app.Promise;
import lime.utils.AssetLibrary;
import lime.utils.AssetManifest;
import haxe.io.Path;
import lime.utils.Assets as LimeAssets;
import openfl.utils.Assets;
class LoadingState extends MusicBeatState
{
inline static var MIN_TIME = 1.0;
var target:FlxState;
var stopMusic = false;
var callbacks:MultiCallback;
var logo:FlxSprite;
var gfDance:FlxSprite;
var danceLeft = false;
function new(target:FlxState, stopMusic:Bool)
{
super();
this.target = target;
this.stopMusic = stopMusic;
}
override function create()
{
logo = new FlxSprite(-150, -100);
@ -52,29 +50,26 @@ class LoadingState extends MusicBeatState
gfDance.antialiasing = true;
add(gfDance);
add(logo);
initSongsManifest().onComplete
(
function (lib)
{
callbacks = new MultiCallback(onLoad);
var introComplete = callbacks.add("introComplete");
checkLoadSong(getSongPath());
if (PlayState.SONG.needsVoices)
checkLoadSong(getVocalPath());
checkLibrary("shared");
if (PlayState.storyWeek > 0)
checkLibrary("week" + PlayState.storyWeek);
else
checkLibrary("tutorial");
var fadeTime = 0.5;
FlxG.camera.fade(FlxG.camera.bgColor, fadeTime, true);
new FlxTimer().start(fadeTime + MIN_TIME, function(_) introComplete());
}
);
initSongsManifest().onComplete(function(lib)
{
callbacks = new MultiCallback(onLoad);
var introComplete = callbacks.add("introComplete");
checkLoadSong(getSongPath());
if (PlayState.SONG.needsVoices)
checkLoadSong(getVocalPath());
checkLibrary("shared");
if (PlayState.storyWeek > 0)
checkLibrary("week" + PlayState.storyWeek);
else
checkLibrary("tutorial");
var fadeTime = 0.5;
FlxG.camera.fade(FlxG.camera.bgColor, fadeTime, true);
new FlxTimer().start(fadeTime + MIN_TIME, function(_) introComplete());
});
}
function checkLoadSong(path:String)
{
if (!Assets.cache.hasSound(path))
@ -86,10 +81,13 @@ class LoadingState extends MusicBeatState
// @:privateAccess
// library.pathGroups.set(symbolPath, [library.__cacheBreak(symbolPath)]);
var callback = callbacks.add("song:" + path);
Assets.loadSound(path).onComplete(function (_) { callback(); });
Assets.loadSound(path).onComplete(function(_)
{
callback();
});
}
}
function checkLibrary(library:String)
{
trace(Assets.hasLibrary(library));
@ -98,25 +96,28 @@ class LoadingState extends MusicBeatState
@:privateAccess
if (!LimeAssets.libraryPaths.exists(library))
throw "Missing library: " + library;
var callback = callbacks.add("library:" + library);
Assets.loadLibrary(library).onComplete(function (_) { callback(); });
Assets.loadLibrary(library).onComplete(function(_)
{
callback();
});
}
}
override function beatHit()
{
super.beatHit();
logo.animation.play('bump');
danceLeft = !danceLeft;
if (danceLeft)
gfDance.animation.play('danceRight');
else
gfDance.animation.play('danceLeft');
}
override function update(elapsed:Float)
{
super.update(elapsed);
@ -125,30 +126,30 @@ class LoadingState extends MusicBeatState
trace('fired: ' + callbacks.getFired() + " unfired:" + callbacks.getUnfired());
#end
}
function onLoad()
{
if (stopMusic && FlxG.sound.music != null)
FlxG.sound.music.stop();
FlxG.switchState(target);
}
static function getSongPath()
{
return Paths.inst(PlayState.SONG.song);
}
static function getVocalPath()
{
return Paths.voices(PlayState.SONG.song);
}
inline static public function loadAndSwitchState(target:FlxState, stopMusic = false)
{
FlxG.switchState(getNextState(target, stopMusic));
}
static function getNextState(target:FlxState, stopMusic = false):FlxState
{
Paths.setCurrentLevel("week" + PlayState.storyWeek);
@ -156,35 +157,35 @@ class LoadingState extends MusicBeatState
var loaded = isSoundLoaded(getSongPath())
&& (!PlayState.SONG.needsVoices || isSoundLoaded(getVocalPath()))
&& isLibraryLoaded("shared");
if (!loaded)
return new LoadingState(target, stopMusic);
#end
if (stopMusic && FlxG.sound.music != null)
FlxG.sound.music.stop();
return target;
}
#if NO_PRELOAD_ALL
static function isSoundLoaded(path:String):Bool
{
return Assets.cache.hasSound(path);
}
static function isLibraryLoaded(library:String):Bool
{
return Assets.getLibrary(library) != null;
}
#end
override function destroy()
{
super.destroy();
callbacks = null;
}
static function initSongsManifest()
{
var id = "songs";
@ -245,7 +246,7 @@ class LoadingState extends MusicBeatState
}
}).onError(function(_)
{
promise.error("There is no asset library with an ID of \"" + id + "\"");
promise.error("There is no asset library with an ID of \"" + id + "\"");
});
return promise.future;
@ -258,33 +259,33 @@ class MultiCallback
public var logId:String = null;
public var length(default, null) = 0;
public var numRemaining(default, null) = 0;
var unfired = new Map<String, Void->Void>();
var fired = new Array<String>();
public function new (callback:Void->Void, logId:String = null)
public function new(callback:Void->Void, logId:String = null)
{
this.callback = callback;
this.logId = logId;
}
public function add(id = "untitled")
{
id = '$length:$id';
length++;
numRemaining++;
var func:Void->Void = null;
func = function ()
func = function()
{
if (unfired.exists(id))
{
unfired.remove(id);
fired.push(id);
numRemaining--;
if (logId != null)
log('fired $id, $numRemaining remaining');
if (numRemaining == 0)
{
if (logId != null)
@ -298,13 +299,16 @@ class MultiCallback
unfired[id] = func;
return func;
}
inline function log(msg):Void
{
if (logId != null)
trace('$logId: $msg');
}
public function getFired() return fired.copy();
public function getUnfired() return [for (id in unfired.keys()) id];
}
public function getFired()
return fired.copy();
public function getUnfired()
return [for (id in unfired.keys()) id];
}

View file

@ -6,7 +6,13 @@ import openfl.Assets;
import openfl.Lib;
import openfl.display.FPS;
import openfl.display.Sprite;
import openfl.events.AsyncErrorEvent;
import openfl.events.Event;
import openfl.events.MouseEvent;
import openfl.events.NetStatusEvent;
import openfl.media.Video;
import openfl.net.NetConnection;
import openfl.net.NetStream;
class Main extends Sprite
{
@ -14,7 +20,12 @@ class Main extends Sprite
var gameHeight:Int = 720; // Height of the game in pixels (might be less / more in actual pixels depending on your zoom).
var initialState:Class<FlxState> = TitleState; // The FlxState the game starts with.
var zoom:Float = -1; // If -1, zoom is automatically calculated to fit the window dimensions.
#if web
var framerate:Int = 60; // How many frames per second the game should run at.
#else
var framerate:Int = 144; // How many frames per second the game should run at.
#end
var skipSplash:Bool = true; // Whether to skip the flixel splash screen that appears in release mode.
var startFullscreen:Bool = false; // Whether to start the game in fullscreen on desktop targets
@ -49,6 +60,10 @@ class Main extends Sprite
setupGame();
}
var video:Video;
var netStream:NetStream;
private var overlay:Sprite;
private function setupGame():Void
{
var stageWidth:Int = Lib.current.stage.stageWidth;
@ -72,5 +87,52 @@ class Main extends Sprite
#if !mobile
addChild(new FPS(10, 3, 0xFFFFFF));
#end
/*
video = new Video();
addChild(video);
var netConnection = new NetConnection();
netConnection.connect(null);
netStream = new NetStream(netConnection);
netStream.client = {onMetaData: client_onMetaData};
netStream.addEventListener(AsyncErrorEvent.ASYNC_ERROR, netStream_onAsyncError);
#if (js && html5)
overlay = new Sprite();
overlay.graphics.beginFill(0, 0.5);
overlay.graphics.drawRect(0, 0, 560, 320);
overlay.addEventListener(MouseEvent.MOUSE_DOWN, overlay_onMouseDown);
overlay.buttonMode = true;
addChild(overlay);
netConnection.addEventListener(NetStatusEvent.NET_STATUS, netConnection_onNetStatus);
#else
netStream.play("assets/preload/music/dredd.mp4");
#end
*/
}
/*
private function client_onMetaData(metaData:Dynamic)
{
video.attachNetStream(netStream);
video.width = video.videoWidth;
video.height = video.videoHeight;
}
private function netStream_onAsyncError(event:AsyncErrorEvent):Void
{
trace("Error loading video");
}
private function netConnection_onNetStatus(event:NetStatusEvent):Void
{
}
private function overlay_onMouseDown(event:MouseEvent):Void
{
netStream.play("assets/preload/music/dredd.mp4");
}
*/
}

150
source/ModdingSubstate.hx Normal file
View file

@ -0,0 +1,150 @@
package;
import Controls.Control;
import flixel.FlxG;
import flixel.group.FlxGroup.FlxTypedGroup;
import flixel.text.FlxText;
import flixel.util.FlxColor;
import polymod.Polymod;
#if desktop
import sys.FileSystem;
#end
class ModdingSubstate extends MusicBeatSubstate
{
var grpMods:FlxTypedGroup<ModMenuItem>;
var enabledMods:Array<String> = [];
var modFolders:Array<String> = [];
var curSelected:Int = 0;
public function new():Void
{
super();
grpMods = new FlxTypedGroup<ModMenuItem>();
add(grpMods);
refreshModList();
}
override function update(elapsed:Float)
{
if (FlxG.keys.justPressed.R)
refreshModList();
selections();
if (controls.UP_P)
selections(-1);
if (controls.DOWN_P)
selections(1);
if (FlxG.keys.justPressed.SPACE)
grpMods.members[curSelected].modEnabled = !grpMods.members[curSelected].modEnabled;
if (FlxG.keys.justPressed.I && curSelected != 0)
{
var oldOne = grpMods.members[curSelected - 1];
grpMods.members[curSelected - 1] = grpMods.members[curSelected];
grpMods.members[curSelected] = oldOne;
selections(-1);
}
if (FlxG.keys.justPressed.K && curSelected < grpMods.members.length - 1)
{
var oldOne = grpMods.members[curSelected + 1];
grpMods.members[curSelected + 1] = grpMods.members[curSelected];
grpMods.members[curSelected] = oldOne;
selections(1);
}
super.update(elapsed);
}
private function selections(change:Int = 0):Void
{
curSelected += change;
if (curSelected >= modFolders.length)
curSelected = 0;
if (curSelected < 0)
curSelected = modFolders.length - 1;
for (txt in 0...grpMods.length)
{
if (txt == curSelected)
{
grpMods.members[txt].color = FlxColor.YELLOW;
}
else
grpMods.members[txt].color = FlxColor.WHITE;
}
organizeByY();
}
private function refreshModList():Void
{
while (grpMods.members.length > 0)
{
grpMods.remove(grpMods.members[0], true);
}
var modList = [];
modFolders = [];
#if desktop
for (file in FileSystem.readDirectory('./mods'))
{
if (FileSystem.isDirectory('./mods/' + file))
modFolders.push(file);
}
enabledMods = [];
modList = Polymod.scan('./mods');
trace(modList);
var loopNum:Int = 0;
for (i in modFolders)
{
var txt:ModMenuItem = new ModMenuItem(0, 10 + (40 * loopNum), 0, i, 32);
txt.text = i;
grpMods.add(txt);
loopNum++;
}
#end
}
private function organizeByY():Void
{
for (i in 0...grpMods.length)
{
grpMods.members[i].y = 10 + (40 * i);
}
}
}
class ModMenuItem extends FlxText
{
public var modEnabled:Bool = false;
public var daMod:String;
public function new(x:Float, y:Float, w:Float, str:String, size:Int)
{
super(x, y, w, str, size);
}
override function update(elapsed:Float)
{
if (modEnabled)
alpha = 1;
else
alpha = 0.5;
super.update(elapsed);
}
}

View file

@ -15,10 +15,16 @@ class OptionsSubState extends MusicBeatSubstate
var grpOptionsTexts:FlxTypedGroup<FlxText>;
// public static var isDownscroll:Bool = false;
public function new()
{
super();
#if desktop
textMenuItems.push('Mods');
#end
grpOptionsTexts = new FlxTypedGroup<FlxText>();
add(grpOptionsTexts);
@ -64,6 +70,9 @@ class OptionsSubState extends MusicBeatSubstate
case "Controls":
FlxG.state.closeSubState();
FlxG.state.openSubState(new ControlsSubState());
case "Mods":
FlxG.state.closeSubState();
FlxG.state.openSubState(new ModdingSubstate());
}
}
}

View file

@ -17,15 +17,28 @@ class PauseSubState extends MusicBeatSubstate
{
var grpMenuShit:FlxTypedGroup<Alphabet>;
var menuItems:Array<String> = ['Resume', 'Restart Song', 'Exit to menu'];
var pauseOG:Array<String> = [
'Resume',
'Restart Song',
'Change Difficulty',
'Toggle Practice Mode',
'Exit to menu'
];
var difficultyChoices:Array<String> = ['EASY', 'NORMAL', 'HARD', 'BACK'];
var menuItems:Array<String> = [];
var curSelected:Int = 0;
var pauseMusic:FlxSound;
var practiceText:FlxText;
public function new(x:Float, y:Float)
{
super();
menuItems = pauseOG;
pauseMusic = new FlxSound().loadEmbedded(Paths.music('breakfast'), true, true);
pauseMusic.volume = 0;
pauseMusic.play(false, FlxG.random.int(0, Std.int(pauseMusic.length / 2)));
@ -51,19 +64,49 @@ class PauseSubState extends MusicBeatSubstate
levelDifficulty.updateHitbox();
add(levelDifficulty);
var deathCounter:FlxText = new FlxText(20, 15 + 64, 0, "", 32);
deathCounter.text = "Blue balled: " + PlayState.deathCounter;
deathCounter.scrollFactor.set();
deathCounter.setFormat(Paths.font('vcr.ttf'), 32);
deathCounter.updateHitbox();
add(deathCounter);
practiceText = new FlxText(20, 15 + 64 + 32, 0, "PRACTICE MODE", 32);
practiceText.scrollFactor.set();
practiceText.setFormat(Paths.font('vcr.ttf'), 32);
practiceText.updateHitbox();
practiceText.x = FlxG.width - (practiceText.width + 20);
practiceText.visible = PlayState.practiceMode;
add(practiceText);
levelDifficulty.alpha = 0;
levelInfo.alpha = 0;
deathCounter.alpha = 0;
levelInfo.x = FlxG.width - (levelInfo.width + 20);
levelDifficulty.x = FlxG.width - (levelDifficulty.width + 20);
deathCounter.x = FlxG.width - (deathCounter.width + 20);
FlxTween.tween(bg, {alpha: 0.6}, 0.4, {ease: FlxEase.quartInOut});
FlxTween.tween(levelInfo, {alpha: 1, y: 20}, 0.4, {ease: FlxEase.quartInOut, startDelay: 0.3});
FlxTween.tween(levelDifficulty, {alpha: 1, y: levelDifficulty.y + 5}, 0.4, {ease: FlxEase.quartInOut, startDelay: 0.5});
FlxTween.tween(deathCounter, {alpha: 1, y: deathCounter.y + 5}, 0.4, {ease: FlxEase.quartInOut, startDelay: 0.7});
grpMenuShit = new FlxTypedGroup<Alphabet>();
add(grpMenuShit);
regenMenu();
// cameras = [FlxG.cameras.list[FlxG.cameras.list.length - 1]];
}
private function regenMenu():Void
{
while (grpMenuShit.members.length > 0)
{
grpMenuShit.remove(grpMenuShit.members[0], true);
}
for (i in 0...menuItems.length)
{
var songText:Alphabet = new Alphabet(0, (70 * i) + 30, menuItems[i], true, false);
@ -72,9 +115,8 @@ class PauseSubState extends MusicBeatSubstate
grpMenuShit.add(songText);
}
curSelected = 0;
changeSelection();
// cameras = [FlxG.cameras.list[FlxG.cameras.list.length - 1]];
}
override function update(elapsed:Float)
@ -105,9 +147,28 @@ class PauseSubState extends MusicBeatSubstate
{
case "Resume":
close();
case "EASY" | 'NORMAL' | "HARD":
PlayState.SONG = Song.loadFromJson(Highscore.formatSong(PlayState.SONG.song.toLowerCase(), curSelected),
PlayState.SONG.song.toLowerCase());
PlayState.storyDifficulty = curSelected;
FlxG.resetState();
case 'Toggle Practice Mode':
PlayState.practiceMode = !PlayState.practiceMode;
practiceText.visible = PlayState.practiceMode;
case 'Change Difficulty':
menuItems = difficultyChoices;
regenMenu();
case 'BACK':
menuItems = pauseOG;
regenMenu();
case "Restart Song":
FlxG.resetState();
case "Exit to menu":
PlayState.deathCounter = 0;
FlxG.switchState(new MainMenuState());
}
}

View file

@ -49,6 +49,8 @@ class PlayState extends MusicBeatState
public static var storyWeek:Int = 0;
public static var storyPlaylist:Array<String> = [];
public static var storyDifficulty:Int = 1;
public static var deathCounter:Int = 0;
public static var practiceMode:Bool = false;
var halloweenLevel:Bool = false;
@ -98,6 +100,8 @@ class PlayState extends MusicBeatState
var phillyTrain:FlxSprite;
var trainSound:FlxSound;
var foregroundSprites:FlxTypedGroup<BGSprite>;
var limo:FlxSprite;
var grpLimoDancers:FlxTypedGroup<BackgroundDancer>;
var fastCar:FlxSprite;
@ -124,7 +128,6 @@ class PlayState extends MusicBeatState
override public function create()
{
if (FlxG.sound.music != null)
FlxG.sound.music.stop();
@ -147,6 +150,8 @@ class PlayState extends MusicBeatState
Conductor.mapBPMChanges(SONG);
Conductor.changeBPM(SONG.bpm);
foregroundSprites = new FlxTypedGroup<BGSprite>();
switch (SONG.song.toLowerCase())
{
case 'tutorial':
@ -174,272 +179,256 @@ class PlayState extends MusicBeatState
dialogue = CoolUtil.coolTextFile(Paths.txt('thorns/thornsDialogue'));
}
if (SONG.song.toLowerCase() == 'spookeez' || SONG.song.toLowerCase() == 'monster' || SONG.song.toLowerCase() == 'south')
switch (SONG.song.toLowerCase())
{
curStage = "spooky";
halloweenLevel = true;
case 'spookeez' | 'monster' | 'south':
curStage = "spooky";
halloweenLevel = true;
var hallowTex = Paths.getSparrowAtlas('halloween_bg');
var hallowTex = Paths.getSparrowAtlas('halloween_bg');
halloweenBG = new FlxSprite(-200, -100);
halloweenBG.frames = hallowTex;
halloweenBG.animation.addByPrefix('idle', 'halloweem bg0');
halloweenBG.animation.addByPrefix('lightning', 'halloweem bg lightning strike', 24, false);
halloweenBG.animation.play('idle');
halloweenBG.antialiasing = true;
add(halloweenBG);
halloweenBG = new FlxSprite(-200, -100);
halloweenBG.frames = hallowTex;
halloweenBG.animation.addByPrefix('idle', 'halloweem bg0');
halloweenBG.animation.addByPrefix('lightning', 'halloweem bg lightning strike', 24, false);
halloweenBG.animation.play('idle');
halloweenBG.antialiasing = true;
add(halloweenBG);
isHalloween = true;
}
else if (SONG.song.toLowerCase() == 'pico' || SONG.song.toLowerCase() == 'blammed' || SONG.song.toLowerCase() == 'philly')
{
curStage = 'philly';
isHalloween = true;
case 'pico' | 'blammed' | 'philly':
curStage = 'philly';
var bg:FlxSprite = new FlxSprite(-100).loadGraphic(Paths.image('philly/sky'));
bg.scrollFactor.set(0.1, 0.1);
add(bg);
var bg:FlxSprite = new FlxSprite(-100).loadGraphic(Paths.image('philly/sky'));
bg.scrollFactor.set(0.1, 0.1);
add(bg);
var city:FlxSprite = new FlxSprite(-10).loadGraphic(Paths.image('philly/city'));
city.scrollFactor.set(0.3, 0.3);
city.setGraphicSize(Std.int(city.width * 0.85));
city.updateHitbox();
add(city);
var city:FlxSprite = new FlxSprite(-10).loadGraphic(Paths.image('philly/city'));
city.scrollFactor.set(0.3, 0.3);
city.setGraphicSize(Std.int(city.width * 0.85));
city.updateHitbox();
add(city);
phillyCityLights = new FlxTypedGroup<FlxSprite>();
add(phillyCityLights);
phillyCityLights = new FlxTypedGroup<FlxSprite>();
add(phillyCityLights);
for (i in 0...5)
{
var light:FlxSprite = new FlxSprite(city.x).loadGraphic(Paths.image('philly/win' + i));
light.scrollFactor.set(0.3, 0.3);
light.visible = false;
light.setGraphicSize(Std.int(light.width * 0.85));
light.updateHitbox();
light.antialiasing = true;
phillyCityLights.add(light);
}
for (i in 0...5)
{
var light:FlxSprite = new FlxSprite(city.x).loadGraphic(Paths.image('philly/win' + i));
light.scrollFactor.set(0.3, 0.3);
light.visible = false;
light.setGraphicSize(Std.int(light.width * 0.85));
light.updateHitbox();
light.antialiasing = true;
phillyCityLights.add(light);
}
var streetBehind:FlxSprite = new FlxSprite(-40, 50).loadGraphic(Paths.image('philly/behindTrain'));
add(streetBehind);
var streetBehind:FlxSprite = new FlxSprite(-40, 50).loadGraphic(Paths.image('philly/behindTrain'));
add(streetBehind);
phillyTrain = new FlxSprite(2000, 360).loadGraphic(Paths.image('philly/train'));
add(phillyTrain);
phillyTrain = new FlxSprite(2000, 360).loadGraphic(Paths.image('philly/train'));
add(phillyTrain);
trainSound = new FlxSound().loadEmbedded(Paths.sound('train_passes'));
FlxG.sound.list.add(trainSound);
trainSound = new FlxSound().loadEmbedded(Paths.sound('train_passes'));
FlxG.sound.list.add(trainSound);
// var cityLights:FlxSprite = new FlxSprite().loadGraphic(AssetPaths.win0.png);
// var cityLights:FlxSprite = new FlxSprite().loadGraphic(AssetPaths.win0.png);
var street:FlxSprite = new FlxSprite(-40, streetBehind.y).loadGraphic(Paths.image('philly/street'));
add(street);
}
else if (SONG.song.toLowerCase() == 'milf' || SONG.song.toLowerCase() == 'satin-panties' || SONG.song.toLowerCase() == 'high')
{
curStage = 'limo';
defaultCamZoom = 0.90;
var street:FlxSprite = new FlxSprite(-40, streetBehind.y).loadGraphic(Paths.image('philly/street'));
add(street);
case "milf" | 'satin-panties' | 'high':
curStage = 'limo';
defaultCamZoom = 0.90;
var skyBG:FlxSprite = new FlxSprite(-120, -50).loadGraphic(Paths.image('limo/limoSunset'));
skyBG.scrollFactor.set(0.1, 0.1);
add(skyBG);
var skyBG:FlxSprite = new FlxSprite(-120, -50).loadGraphic(Paths.image('limo/limoSunset'));
skyBG.scrollFactor.set(0.1, 0.1);
add(skyBG);
var bgLimo:FlxSprite = new FlxSprite(-200, 480);
bgLimo.frames = Paths.getSparrowAtlas('limo/bgLimo');
bgLimo.animation.addByPrefix('drive', "background limo pink", 24);
bgLimo.animation.play('drive');
bgLimo.scrollFactor.set(0.4, 0.4);
add(bgLimo);
var bgLimo:FlxSprite = new FlxSprite(-200, 480);
bgLimo.frames = Paths.getSparrowAtlas('limo/bgLimo');
bgLimo.animation.addByPrefix('drive', "background limo pink", 24);
bgLimo.animation.play('drive');
bgLimo.scrollFactor.set(0.4, 0.4);
add(bgLimo);
grpLimoDancers = new FlxTypedGroup<BackgroundDancer>();
add(grpLimoDancers);
grpLimoDancers = new FlxTypedGroup<BackgroundDancer>();
add(grpLimoDancers);
for (i in 0...5)
{
var dancer:BackgroundDancer = new BackgroundDancer((370 * i) + 130, bgLimo.y - 400);
dancer.scrollFactor.set(0.4, 0.4);
grpLimoDancers.add(dancer);
}
for (i in 0...5)
{
var dancer:BackgroundDancer = new BackgroundDancer((370 * i) + 130, bgLimo.y - 400);
dancer.scrollFactor.set(0.4, 0.4);
grpLimoDancers.add(dancer);
}
var overlayShit:FlxSprite = new FlxSprite(-500, -600).loadGraphic(Paths.image('limo/limoOverlay'));
overlayShit.alpha = 0.5;
// add(overlayShit);
var overlayShit:FlxSprite = new FlxSprite(-500, -600).loadGraphic(Paths.image('limo/limoOverlay'));
overlayShit.alpha = 0.5;
// add(overlayShit);
// var shaderBullshit = new BlendModeEffect(new OverlayShader(), FlxColor.RED);
// FlxG.camera.setFilters([new ShaderFilter(cast shaderBullshit.shader)]);
// overlayShit.shader = shaderBullshit;
// var shaderBullshit = new BlendModeEffect(new OverlayShader(), FlxColor.RED);
limo = new FlxSprite(-120, 550);
limo.frames = Paths.getSparrowAtlas('limo/limoDrive');
limo.animation.addByPrefix('drive', "Limo stage", 24);
limo.animation.play('drive');
limo.antialiasing = true;
// FlxG.camera.setFilters([new ShaderFilter(cast shaderBullshit.shader)]);
// overlayShit.shader = shaderBullshit;
var limoTex = Paths.getSparrowAtlas('limo/limoDrive');
limo = new FlxSprite(-120, 550);
limo.frames = limoTex;
limo.animation.addByPrefix('drive', "Limo stage", 24);
limo.animation.play('drive');
limo.antialiasing = true;
fastCar = new FlxSprite(-300, 160).loadGraphic(Paths.image('limo/fastCarLol'));
fastCar = new FlxSprite(-300, 160).loadGraphic(Paths.image('limo/fastCarLol'));
// add(limo);
}
else if (SONG.song.toLowerCase() == 'cocoa' || SONG.song.toLowerCase() == 'eggnog')
{
curStage = 'mall';
case "cocoa" | 'eggnog':
curStage = 'mall';
defaultCamZoom = 0.80;
defaultCamZoom = 0.80;
var bg:FlxSprite = new FlxSprite(-1000, -500).loadGraphic(Paths.image('christmas/bgWalls'));
bg.antialiasing = true;
bg.scrollFactor.set(0.2, 0.2);
bg.active = false;
bg.setGraphicSize(Std.int(bg.width * 0.8));
bg.updateHitbox();
add(bg);
var bg:FlxSprite = new FlxSprite(-1000, -500).loadGraphic(Paths.image('christmas/bgWalls'));
bg.antialiasing = true;
bg.scrollFactor.set(0.2, 0.2);
bg.active = false;
bg.setGraphicSize(Std.int(bg.width * 0.8));
bg.updateHitbox();
add(bg);
upperBoppers = new FlxSprite(-240, -90);
upperBoppers.frames = Paths.getSparrowAtlas('christmas/upperBop');
upperBoppers.animation.addByPrefix('bop', "Upper Crowd Bob", 24, false);
upperBoppers.antialiasing = true;
upperBoppers.scrollFactor.set(0.33, 0.33);
upperBoppers.setGraphicSize(Std.int(upperBoppers.width * 0.85));
upperBoppers.updateHitbox();
add(upperBoppers);
upperBoppers = new FlxSprite(-240, -90);
upperBoppers.frames = Paths.getSparrowAtlas('christmas/upperBop');
upperBoppers.animation.addByPrefix('bop', "Upper Crowd Bob", 24, false);
upperBoppers.antialiasing = true;
upperBoppers.scrollFactor.set(0.33, 0.33);
upperBoppers.setGraphicSize(Std.int(upperBoppers.width * 0.85));
upperBoppers.updateHitbox();
add(upperBoppers);
var bgEscalator:FlxSprite = new FlxSprite(-1100, -600).loadGraphic(Paths.image('christmas/bgEscalator'));
bgEscalator.antialiasing = true;
bgEscalator.scrollFactor.set(0.3, 0.3);
bgEscalator.active = false;
bgEscalator.setGraphicSize(Std.int(bgEscalator.width * 0.9));
bgEscalator.updateHitbox();
add(bgEscalator);
var bgEscalator:FlxSprite = new FlxSprite(-1100, -600).loadGraphic(Paths.image('christmas/bgEscalator'));
bgEscalator.antialiasing = true;
bgEscalator.scrollFactor.set(0.3, 0.3);
bgEscalator.active = false;
bgEscalator.setGraphicSize(Std.int(bgEscalator.width * 0.9));
bgEscalator.updateHitbox();
add(bgEscalator);
var tree:FlxSprite = new FlxSprite(370, -250).loadGraphic(Paths.image('christmas/christmasTree'));
tree.antialiasing = true;
tree.scrollFactor.set(0.40, 0.40);
add(tree);
var tree:FlxSprite = new FlxSprite(370, -250).loadGraphic(Paths.image('christmas/christmasTree'));
tree.antialiasing = true;
tree.scrollFactor.set(0.40, 0.40);
add(tree);
bottomBoppers = new FlxSprite(-300, 140);
bottomBoppers.frames = Paths.getSparrowAtlas('christmas/bottomBop');
bottomBoppers.animation.addByPrefix('bop', 'Bottom Level Boppers', 24, false);
bottomBoppers.antialiasing = true;
bottomBoppers.scrollFactor.set(0.9, 0.9);
bottomBoppers.setGraphicSize(Std.int(bottomBoppers.width * 1));
bottomBoppers.updateHitbox();
add(bottomBoppers);
bottomBoppers = new FlxSprite(-300, 140);
bottomBoppers.frames = Paths.getSparrowAtlas('christmas/bottomBop');
bottomBoppers.animation.addByPrefix('bop', 'Bottom Level Boppers', 24, false);
bottomBoppers.antialiasing = true;
bottomBoppers.scrollFactor.set(0.9, 0.9);
bottomBoppers.setGraphicSize(Std.int(bottomBoppers.width * 1));
bottomBoppers.updateHitbox();
add(bottomBoppers);
var fgSnow:FlxSprite = new FlxSprite(-600, 700).loadGraphic(Paths.image('christmas/fgSnow'));
fgSnow.active = false;
fgSnow.antialiasing = true;
add(fgSnow);
var fgSnow:FlxSprite = new FlxSprite(-600, 700).loadGraphic(Paths.image('christmas/fgSnow'));
fgSnow.active = false;
fgSnow.antialiasing = true;
add(fgSnow);
santa = new FlxSprite(-840, 150);
santa.frames = Paths.getSparrowAtlas('christmas/santa');
santa.animation.addByPrefix('idle', 'santa idle in fear', 24, false);
santa.antialiasing = true;
add(santa);
}
else if (SONG.song.toLowerCase() == 'winter-horrorland')
{
curStage = 'mallEvil';
var bg:FlxSprite = new FlxSprite(-400, -500).loadGraphic(Paths.image('christmas/evilBG'));
bg.antialiasing = true;
bg.scrollFactor.set(0.2, 0.2);
bg.active = false;
bg.setGraphicSize(Std.int(bg.width * 0.8));
bg.updateHitbox();
add(bg);
santa = new FlxSprite(-840, 150);
santa.frames = Paths.getSparrowAtlas('christmas/santa');
santa.animation.addByPrefix('idle', 'santa idle in fear', 24, false);
santa.antialiasing = true;
add(santa);
case 'winter-horrorland':
curStage = 'mallEvil';
var bg:FlxSprite = new FlxSprite(-400, -500).loadGraphic(Paths.image('christmas/evilBG'));
bg.antialiasing = true;
bg.scrollFactor.set(0.2, 0.2);
bg.active = false;
bg.setGraphicSize(Std.int(bg.width * 0.8));
bg.updateHitbox();
add(bg);
var evilTree:FlxSprite = new FlxSprite(300, -300).loadGraphic(Paths.image('christmas/evilTree'));
evilTree.antialiasing = true;
evilTree.scrollFactor.set(0.2, 0.2);
add(evilTree);
var evilTree:FlxSprite = new FlxSprite(300, -300).loadGraphic(Paths.image('christmas/evilTree'));
evilTree.antialiasing = true;
evilTree.scrollFactor.set(0.2, 0.2);
add(evilTree);
var evilSnow:FlxSprite = new FlxSprite(-200, 700).loadGraphic(Paths.image("christmas/evilSnow"));
evilSnow.antialiasing = true;
add(evilSnow);
}
else if (SONG.song.toLowerCase() == 'senpai' || SONG.song.toLowerCase() == 'roses')
{
curStage = 'school';
var evilSnow:FlxSprite = new FlxSprite(-200, 700).loadGraphic(Paths.image("christmas/evilSnow"));
evilSnow.antialiasing = true;
add(evilSnow);
case 'senpai' | 'roses':
curStage = 'school';
// defaultCamZoom = 0.9;
// defaultCamZoom = 0.9;
var bgSky = new FlxSprite().loadGraphic(Paths.image('weeb/weebSky'));
bgSky.scrollFactor.set(0.1, 0.1);
add(bgSky);
var bgSky = new FlxSprite().loadGraphic(Paths.image('weeb/weebSky'));
bgSky.scrollFactor.set(0.1, 0.1);
add(bgSky);
var repositionShit = -200;
var repositionShit = -200;
var bgSchool:FlxSprite = new FlxSprite(repositionShit, 0).loadGraphic(Paths.image('weeb/weebSchool'));
bgSchool.scrollFactor.set(0.6, 0.90);
add(bgSchool);
var bgSchool:FlxSprite = new FlxSprite(repositionShit, 0).loadGraphic(Paths.image('weeb/weebSchool'));
bgSchool.scrollFactor.set(0.6, 0.90);
add(bgSchool);
var bgStreet:FlxSprite = new FlxSprite(repositionShit).loadGraphic(Paths.image('weeb/weebStreet'));
bgStreet.scrollFactor.set(0.95, 0.95);
add(bgStreet);
var bgStreet:FlxSprite = new FlxSprite(repositionShit).loadGraphic(Paths.image('weeb/weebStreet'));
bgStreet.scrollFactor.set(0.95, 0.95);
add(bgStreet);
var fgTrees:FlxSprite = new FlxSprite(repositionShit + 170, 130).loadGraphic(Paths.image('weeb/weebTreesBack'));
fgTrees.scrollFactor.set(0.9, 0.9);
add(fgTrees);
var fgTrees:FlxSprite = new FlxSprite(repositionShit + 170, 130).loadGraphic(Paths.image('weeb/weebTreesBack'));
fgTrees.scrollFactor.set(0.9, 0.9);
add(fgTrees);
var bgTrees:FlxSprite = new FlxSprite(repositionShit - 380, -800);
var treetex = Paths.getPackerAtlas('weeb/weebTrees');
bgTrees.frames = treetex;
bgTrees.animation.add('treeLoop', [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18], 12);
bgTrees.animation.play('treeLoop');
bgTrees.scrollFactor.set(0.85, 0.85);
add(bgTrees);
var bgTrees:FlxSprite = new FlxSprite(repositionShit - 380, -800);
var treetex = Paths.getPackerAtlas('weeb/weebTrees');
bgTrees.frames = treetex;
bgTrees.animation.add('treeLoop', [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18], 12);
bgTrees.animation.play('treeLoop');
bgTrees.scrollFactor.set(0.85, 0.85);
add(bgTrees);
var treeLeaves:FlxSprite = new FlxSprite(repositionShit, -40);
treeLeaves.frames = Paths.getSparrowAtlas('weeb/petals');
treeLeaves.animation.addByPrefix('leaves', 'PETALS ALL', 24, true);
treeLeaves.animation.play('leaves');
treeLeaves.scrollFactor.set(0.85, 0.85);
add(treeLeaves);
var treeLeaves:FlxSprite = new FlxSprite(repositionShit, -40);
treeLeaves.frames = Paths.getSparrowAtlas('weeb/petals');
treeLeaves.animation.addByPrefix('leaves', 'PETALS ALL', 24, true);
treeLeaves.animation.play('leaves');
treeLeaves.scrollFactor.set(0.85, 0.85);
add(treeLeaves);
var widShit = Std.int(bgSky.width * 6);
var widShit = Std.int(bgSky.width * 6);
bgSky.setGraphicSize(widShit);
bgSchool.setGraphicSize(widShit);
bgStreet.setGraphicSize(widShit);
bgTrees.setGraphicSize(Std.int(widShit * 1.4));
fgTrees.setGraphicSize(Std.int(widShit * 0.8));
treeLeaves.setGraphicSize(widShit);
bgSky.setGraphicSize(widShit);
bgSchool.setGraphicSize(widShit);
bgStreet.setGraphicSize(widShit);
bgTrees.setGraphicSize(Std.int(widShit * 1.4));
fgTrees.setGraphicSize(Std.int(widShit * 0.8));
treeLeaves.setGraphicSize(widShit);
fgTrees.updateHitbox();
bgSky.updateHitbox();
bgSchool.updateHitbox();
bgStreet.updateHitbox();
bgTrees.updateHitbox();
treeLeaves.updateHitbox();
fgTrees.updateHitbox();
bgSky.updateHitbox();
bgSchool.updateHitbox();
bgStreet.updateHitbox();
bgTrees.updateHitbox();
treeLeaves.updateHitbox();
bgGirls = new BackgroundGirls(-100, 190);
bgGirls.scrollFactor.set(0.9, 0.9);
bgGirls = new BackgroundGirls(-100, 190);
bgGirls.scrollFactor.set(0.9, 0.9);
if (SONG.song.toLowerCase() == 'roses')
{
bgGirls.getScared();
}
if (SONG.song.toLowerCase() == 'roses')
{
bgGirls.getScared();
}
bgGirls.setGraphicSize(Std.int(bgGirls.width * daPixelZoom));
bgGirls.updateHitbox();
add(bgGirls);
}
else if (SONG.song.toLowerCase() == 'thorns')
{
curStage = 'schoolEvil';
bgGirls.setGraphicSize(Std.int(bgGirls.width * daPixelZoom));
bgGirls.updateHitbox();
add(bgGirls);
case 'thorns':
curStage = 'schoolEvil';
var waveEffectBG = new FlxWaveEffect(FlxWaveMode.ALL, 2, -1, 3, 2);
var waveEffectFG = new FlxWaveEffect(FlxWaveMode.ALL, 2, -1, 5, 2);
var waveEffectBG = new FlxWaveEffect(FlxWaveMode.ALL, 2, -1, 3, 2);
var waveEffectFG = new FlxWaveEffect(FlxWaveMode.ALL, 2, -1, 5, 2);
var posX = 400;
var posY = 200;
var posX = 400;
var posY = 200;
var bg:FlxSprite = new FlxSprite(posX, posY);
bg.frames = Paths.getSparrowAtlas('weeb/animatedEvilSchool');
bg.animation.addByPrefix('idle', 'background 2', 24);
bg.animation.play('idle');
bg.scrollFactor.set(0.8, 0.9);
bg.scale.set(6, 6);
add(bg);
var bg:FlxSprite = new FlxSprite(posX, posY);
bg.frames = Paths.getSparrowAtlas('weeb/animatedEvilSchool');
bg.animation.addByPrefix('idle', 'background 2', 24);
bg.animation.play('idle');
bg.scrollFactor.set(0.8, 0.9);
bg.scale.set(6, 6);
add(bg);
/*
var bg:FlxSprite = new FlxSprite(posX, posY).loadGraphic(Paths.image('weeb/evilSchoolBG'));
@ -484,33 +473,74 @@ class PlayState extends MusicBeatState
add(waveSprite);
add(waveSpriteFG);
*/
}
else
{
defaultCamZoom = 0.9;
curStage = 'stage';
var bg:FlxSprite = new FlxSprite(-600, -200).loadGraphic(Paths.image('stageback'));
bg.antialiasing = true;
bg.scrollFactor.set(0.9, 0.9);
bg.active = false;
add(bg);
var stageFront:FlxSprite = new FlxSprite(-650, 600).loadGraphic(Paths.image('stagefront'));
stageFront.setGraphicSize(Std.int(stageFront.width * 1.1));
stageFront.updateHitbox();
stageFront.antialiasing = true;
stageFront.scrollFactor.set(0.9, 0.9);
stageFront.active = false;
add(stageFront);
case 'guns' | 'stress' | 'ugh':
// defaultCamZoom = 0.95;
curStage = 'tank';
var stageCurtains:FlxSprite = new FlxSprite(-500, -300).loadGraphic(Paths.image('stagecurtains'));
stageCurtains.setGraphicSize(Std.int(stageCurtains.width * 0.9));
stageCurtains.updateHitbox();
stageCurtains.antialiasing = true;
stageCurtains.scrollFactor.set(1.3, 1.3);
stageCurtains.active = false;
var bg:BGSprite = new BGSprite('tankSky', 0, -200, 0, 0);
add(bg);
add(stageCurtains);
var tankSky:BGSprite = new BGSprite('tankClouds', 0, 10, 0.1, 0.1);
add(tankSky);
var tankMountains:BGSprite = new BGSprite('tankMountains', -100, 150, 0.2, 0.2);
add(tankMountains);
var tankBuildings:BGSprite = new BGSprite('tankBuildings', -200, 370, 0.25, 0.25);
add(tankBuildings);
var tankRuins:BGSprite = new BGSprite('tankRuins', -200, 170, 0.35, 0.35);
add(tankRuins);
var tankWatchtower:BGSprite = new BGSprite('tankWatchtower', 300, 50, 0.5, 0.5);
add(tankWatchtower);
var tankGround:BGSprite = new BGSprite('tankGround', -200, -20);
add(tankGround);
var fgTank0:BGSprite = new BGSprite('tank0', -290, 400, 1.7, 1.5, ['fg']);
foregroundSprites.add(fgTank0);
var fgTank1:BGSprite = new BGSprite('tank1', -100, 680, 2, 0.2, ['fg']);
foregroundSprites.add(fgTank1);
// just called 'foreground' just cuz small inconsistency no bbiggei
var fgTank2:BGSprite = new BGSprite('tank2', 450, 840, 1.5, 1.5, ['foreground']);
foregroundSprites.add(fgTank2);
var fgTank4:BGSprite = new BGSprite('tank4', 1000, 880, 1.5, 1.5, ['fg']);
foregroundSprites.add(fgTank4);
var fgTank5:BGSprite = new BGSprite('tank5', 1400, 600, 1.5, 1.5, ['fg']);
foregroundSprites.add(fgTank5);
var fgTank3:BGSprite = new BGSprite('tank3', 1300, 1130, 3.5, 2.5, ['fg']);
foregroundSprites.add(fgTank3);
default:
defaultCamZoom = 0.9;
curStage = 'stage';
var bg:BGSprite = new BGSprite('stageback', -600, -200, 0.9, 0.9);
add(bg);
var stageFront:FlxSprite = new FlxSprite(-650, 600).loadGraphic(Paths.image('stagefront'));
stageFront.setGraphicSize(Std.int(stageFront.width * 1.1));
stageFront.updateHitbox();
stageFront.antialiasing = true;
stageFront.scrollFactor.set(0.9, 0.9);
stageFront.active = false;
add(stageFront);
var stageCurtains:FlxSprite = new FlxSprite(-500, -300).loadGraphic(Paths.image('stagecurtains'));
stageCurtains.setGraphicSize(Std.int(stageCurtains.width * 0.9));
stageCurtains.updateHitbox();
stageCurtains.antialiasing = true;
stageCurtains.scrollFactor.set(1.3, 1.3);
stageCurtains.active = false;
add(stageCurtains);
}
var gfVersion:String = 'gf';
@ -530,9 +560,19 @@ class PlayState extends MusicBeatState
if (curStage == 'limo')
gfVersion = 'gf-car';
if (SONG.song.toLowerCase() == 'stress')
gfVersion = 'pico-speaker';
gf = new Character(400, 130, gfVersion);
gf.scrollFactor.set(0.95, 0.95);
switch (gfVersion)
{
case 'pico-speaker':
gf.x -= 50;
gf.y -= 200;
}
dad = new Character(100, 100, SONG.player2);
var camPos:FlxPoint = new FlxPoint(dad.getGraphicMidpoint().x, dad.getGraphicMidpoint().y);
@ -573,6 +613,8 @@ class PlayState extends MusicBeatState
dad.x -= 150;
dad.y += 100;
camPos.set(dad.getGraphicMidpoint().x + 300, dad.getGraphicMidpoint().y);
case 'tankman':
dad.y += 180;
}
boyfriend = new Boyfriend(770, 450, SONG.player1);
@ -622,6 +664,8 @@ class PlayState extends MusicBeatState
add(dad);
add(boyfriend);
add(foregroundSprites);
var doof:DialogueBox = new DialogueBox(false, dialogue);
// doof.x += 70;
// doof.y = FlxG.height * 0.5;
@ -870,16 +914,8 @@ class PlayState extends MusicBeatState
var introAssets:Map<String, Array<String>> = new Map<String, Array<String>>();
introAssets.set('default', ['ready', "set", "go"]);
introAssets.set('school', [
'weeb/pixelUI/ready-pixel',
'weeb/pixelUI/set-pixel',
'weeb/pixelUI/date-pixel'
]);
introAssets.set('schoolEvil', [
'weeb/pixelUI/ready-pixel',
'weeb/pixelUI/set-pixel',
'weeb/pixelUI/date-pixel'
]);
introAssets.set('school', ['weeb/pixelUI/ready-pixel', 'weeb/pixelUI/set-pixel', 'weeb/pixelUI/date-pixel']);
introAssets.set('schoolEvil', ['weeb/pixelUI/ready-pixel', 'weeb/pixelUI/set-pixel', 'weeb/pixelUI/date-pixel']);
var introAlts:Array<String> = introAssets.get('default');
var altSuffix:String = "";
@ -1477,7 +1513,7 @@ class PlayState extends MusicBeatState
}
#end
if (health <= 0)
if (health <= 0 && !practiceMode)
{
boyfriend.stunned = true;
@ -1488,6 +1524,8 @@ class PlayState extends MusicBeatState
vocals.stop();
FlxG.sound.music.stop();
deathCounter += 1;
openSubState(new GameOverSubstate(boyfriend.getScreenPosition().x, boyfriend.getScreenPosition().y));
// FlxG.switchState(new GameOverState(boyfriend.getScreenPosition().x, boyfriend.getScreenPosition().y));
@ -1601,6 +1639,7 @@ class PlayState extends MusicBeatState
function endSong():Void
{
deathCounter = 0;
canPause = false;
FlxG.sound.music.volume = 0;
vocals.volume = 0;
@ -1925,29 +1964,29 @@ class PlayState extends MusicBeatState
*/
// trace(daNote.noteData);
/*
switch (daNote.noteData)
switch (daNote.noteData)
{
case 2: // NOTES YOU JUST PRESSED
if (upP || rightP || downP || leftP)
noteCheck(upP, daNote);
case 3:
if (upP || rightP || downP || leftP)
noteCheck(rightP, daNote);
case 1:
if (upP || rightP || downP || leftP)
noteCheck(downP, daNote);
case 0:
if (upP || rightP || downP || leftP)
noteCheck(leftP, daNote);
}
//this is already done in noteCheck / goodNoteHit
if (daNote.wasGoodHit)
{
case 2: // NOTES YOU JUST PRESSED
if (upP || rightP || downP || leftP)
noteCheck(upP, daNote);
case 3:
if (upP || rightP || downP || leftP)
noteCheck(rightP, daNote);
case 1:
if (upP || rightP || downP || leftP)
noteCheck(downP, daNote);
case 0:
if (upP || rightP || downP || leftP)
noteCheck(leftP, daNote);
daNote.kill();
notes.remove(daNote, true);
daNote.destroy();
}
//this is already done in noteCheck / goodNoteHit
if (daNote.wasGoodHit)
{
daNote.kill();
notes.remove(daNote, true);
daNote.destroy();
}
*/
}
else
@ -2312,6 +2351,11 @@ class PlayState extends MusicBeatState
}
}
foregroundSprites.forEach(function(spr:BGSprite)
{
spr.dance();
});
switch (curStage)
{
case 'school':

View file

@ -2,20 +2,14 @@ package;
import flixel.FlxG;
import flixel.FlxSprite;
import flixel.FlxState;
import flixel.addons.display.FlxGridOverlay;
import flixel.addons.transition.FlxTransitionSprite.GraphicTransTileDiamond;
import flixel.addons.transition.FlxTransitionableState;
import flixel.addons.transition.TransitionData;
import flixel.graphics.FlxGraphic;
import flixel.graphics.frames.FlxAtlasFrames;
import flixel.group.FlxGroup;
import flixel.input.gamepad.FlxGamepad;
import flixel.math.FlxPoint;
import flixel.math.FlxRect;
import flixel.system.FlxSound;
import flixel.system.ui.FlxSoundTray;
import flixel.text.FlxText;
import flixel.tweens.FlxEase;
import flixel.tweens.FlxTween;
import flixel.util.FlxColor;
@ -42,9 +36,11 @@ class TitleState extends MusicBeatState
override public function create():Void
{
#if polymod
polymod.Polymod.init({modRoot: "mods", dirs: ['introMod']});
polymod.Polymod.init({modRoot: "mods", dirs: ['introMod'], framework: OPENFL});
#end
FlxG.sound.muteKeys = [ZERO];
PlayerSettings.init();
curWacky = FlxG.random.getObject(getIntroTextShit());
@ -217,6 +213,17 @@ class TitleState extends MusicBeatState
override function update(elapsed:Float)
{
/*
if (FlxG.keys.justPressed.R)
{
#if polymod
polymod.Polymod.init({modRoot: "mods", dirs: ['introMod']});
trace('reinitialized');
#end
}
*/
if (FlxG.sound.music != null)
Conductor.songPosition = FlxG.sound.music.time;
// FlxG.watch.addQuick('amp', FlxG.sound.music.amplitude);