mirror of
https://github.com/ninjamuffin99/Funkin.git
synced 2025-03-21 17:39:20 +00:00
CHARTS
This commit is contained in:
parent
84eca4325c
commit
b07372aa8e
|
@ -58,6 +58,7 @@
|
|||
<!-- _______________________________ Libraries ______________________________ -->
|
||||
|
||||
<haxelib name="flixel" />
|
||||
<haxedev set='webgl' />
|
||||
|
||||
<!--In case you want to use the addons package-->
|
||||
<haxelib name="flixel-addons" />
|
||||
|
|
34
source/BlendModeEffect.hx
Normal file
34
source/BlendModeEffect.hx
Normal file
|
@ -0,0 +1,34 @@
|
|||
package;
|
||||
|
||||
import flixel.util.FlxColor;
|
||||
import openfl.display.ShaderParameter;
|
||||
|
||||
typedef BlendModeShader =
|
||||
{
|
||||
var uBlendColor:ShaderParameter<Float>;
|
||||
}
|
||||
|
||||
class BlendModeEffect
|
||||
{
|
||||
public var shader(default, null):BlendModeShader;
|
||||
|
||||
@:isVar
|
||||
public var color(default, set):FlxColor;
|
||||
|
||||
public function new(shader:BlendModeShader, color:FlxColor):Void
|
||||
{
|
||||
shader.uBlendColor.value = [];
|
||||
this.shader = shader;
|
||||
this.color = color;
|
||||
}
|
||||
|
||||
function set_color(color:FlxColor):FlxColor
|
||||
{
|
||||
shader.uBlendColor.value[0] = color.redFloat;
|
||||
shader.uBlendColor.value[1] = color.greenFloat;
|
||||
shader.uBlendColor.value[2] = color.blueFloat;
|
||||
shader.uBlendColor.value[3] = color.alphaFloat;
|
||||
|
||||
return this.color = color;
|
||||
}
|
||||
}
|
|
@ -241,9 +241,9 @@ class ChartingState extends MusicBeatState
|
|||
stepperSectionBPM.value = Conductor.bpm;
|
||||
stepperSectionBPM.name = 'section_bpm';
|
||||
|
||||
var stepperCopy:FlxUINumericStepper = new FlxUINumericStepper(110, 30, 1, 1, -999, 999, 0);
|
||||
var stepperCopy:FlxUINumericStepper = new FlxUINumericStepper(110, 130, 1, 1, -999, 999, 0);
|
||||
|
||||
var copyButton:FlxButton = new FlxButton(110, 8, "Copy last section", function()
|
||||
var copyButton:FlxButton = new FlxButton(10, 130, "Copy last section", function()
|
||||
{
|
||||
copySection(Std.int(stepperCopy.value));
|
||||
});
|
||||
|
|
|
@ -12,7 +12,7 @@ import lime.utils.Assets;
|
|||
|
||||
class FreeplayState extends MusicBeatState
|
||||
{
|
||||
var songs:Array<String> = ["Milf", "Bopeebo", "Dadbattle", "Fresh", "Tutorial"];
|
||||
var songs:Array<String> = ["High", "Milf", "Bopeebo", "Dadbattle", "Fresh", "Tutorial"];
|
||||
|
||||
var selector:FlxText;
|
||||
var curSelected:Int = 0;
|
||||
|
|
33
source/OverlayShader.hx
Normal file
33
source/OverlayShader.hx
Normal file
|
@ -0,0 +1,33 @@
|
|||
package;
|
||||
|
||||
import flixel.system.FlxAssets.FlxShader;
|
||||
|
||||
class OverlayShader extends FlxShader
|
||||
{
|
||||
@:glFragmentSource('
|
||||
#pragma header
|
||||
uniform vec4 uBlendColor;
|
||||
|
||||
vec3 blendLighten(base:Vec3, blend:Vec3) : Vec3 {
|
||||
return mix(
|
||||
1.0 - 2.0 * (1.0 - base) * (1.0 - blend),
|
||||
2.0 * base * blend,
|
||||
step( base, vec3(0.5) )
|
||||
);
|
||||
}
|
||||
|
||||
vec4 blendLighten(vec4 base, vec4 blend, float opacity)
|
||||
{
|
||||
return (blendLighten(base, blend) * opacity + base * (1.0 - opacity));
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 base = texture2D(bitmap, openfl_TextureCoordv);
|
||||
gl_FragColor = blendLighten(base, uBlendColor, uBlendColor.a);
|
||||
}')
|
||||
public function new()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
|
@ -46,7 +46,7 @@ class PauseSubState extends MusicBeatSubstate
|
|||
|
||||
changeSelection();
|
||||
|
||||
cameras = [FlxG.cameras.list[1]];
|
||||
cameras = [FlxG.cameras.list[FlxG.cameras.list.length - 1]];
|
||||
}
|
||||
|
||||
override function update(elapsed:Float)
|
||||
|
|
|
@ -29,6 +29,8 @@ import flixel.util.FlxStringUtil;
|
|||
import flixel.util.FlxTimer;
|
||||
import haxe.Json;
|
||||
import lime.utils.Assets;
|
||||
import openfl.display.BlendMode;
|
||||
import openfl.filters.ShaderFilter;
|
||||
|
||||
using StringTools;
|
||||
|
||||
|
@ -87,12 +89,16 @@ class PlayState extends MusicBeatState
|
|||
var phillyTrain:FlxSprite;
|
||||
var trainSound:FlxSound;
|
||||
|
||||
var limo:FlxSprite;
|
||||
|
||||
var talking:Bool = true;
|
||||
var songScore:Int = 0;
|
||||
var scoreTxt:FlxText;
|
||||
|
||||
public static var campaignScore:Int = 0;
|
||||
|
||||
var defaultCamZoom:Float = 1.05;
|
||||
|
||||
override public function create()
|
||||
{
|
||||
// var gameCam:FlxCamera = FlxG.camera;
|
||||
|
@ -192,6 +198,41 @@ class PlayState extends MusicBeatState
|
|||
var street:FlxSprite = new FlxSprite(-40, streetBehind.y).loadGraphic(AssetPaths.street__png);
|
||||
add(street);
|
||||
}
|
||||
else if (SONG.song.toLowerCase() == 'milf' || SONG.song.toLowerCase() == 'satin-panties' || SONG.song.toLowerCase() == 'high')
|
||||
{
|
||||
curStage = 'limo';
|
||||
defaultCamZoom = 0.90;
|
||||
|
||||
var skyBG:FlxSprite = new FlxSprite(-120, -50).loadGraphic(AssetPaths.limoSunset__png);
|
||||
skyBG.scrollFactor.set(0.1, 0.1);
|
||||
add(skyBG);
|
||||
|
||||
var bgLimo:FlxSprite = new FlxSprite(-200, 400);
|
||||
bgLimo.frames = FlxAtlasFrames.fromSparrow(AssetPaths.bgLimo__png, AssetPaths.bgLimo__xml);
|
||||
bgLimo.animation.addByPrefix('drive', "BG limo", 24);
|
||||
bgLimo.animation.play('drive');
|
||||
bgLimo.scrollFactor.set(0.4, 0.4);
|
||||
add(bgLimo);
|
||||
|
||||
var overlayShit:FlxSprite = new FlxSprite(-500, -600).loadGraphic(AssetPaths.limoOverlay__png);
|
||||
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 limoTex = FlxAtlasFrames.fromSparrow(AssetPaths.limoDrive__png, AssetPaths.limoDrive__xml);
|
||||
|
||||
limo = new FlxSprite(-120, 550);
|
||||
limo.frames = limoTex;
|
||||
limo.animation.addByPrefix('drive', "Limo stage", 24);
|
||||
limo.animation.play('drive');
|
||||
limo.antialiasing = true;
|
||||
// add(limo);
|
||||
}
|
||||
else
|
||||
{
|
||||
curStage = 'stage';
|
||||
|
@ -226,6 +267,10 @@ class PlayState extends MusicBeatState
|
|||
gf.antialiasing = true;
|
||||
add(gf);
|
||||
|
||||
// Shitty layering but whatev it works LOL
|
||||
if (curStage == 'limo')
|
||||
add(limo);
|
||||
|
||||
dad = new Character(100, 100, SONG.player2);
|
||||
add(dad);
|
||||
|
||||
|
@ -256,6 +301,16 @@ class PlayState extends MusicBeatState
|
|||
boyfriend = new Boyfriend(770, 450);
|
||||
add(boyfriend);
|
||||
|
||||
// REPOSITIONING PER STAGE
|
||||
switch (curStage)
|
||||
{
|
||||
case 'limo':
|
||||
{
|
||||
boyfriend.y -= 220;
|
||||
boyfriend.x += 260;
|
||||
}
|
||||
}
|
||||
|
||||
var doof:DialogueBox = new DialogueBox(false, dialogue);
|
||||
// doof.x += 70;
|
||||
doof.y = FlxG.height * 0.5;
|
||||
|
@ -287,7 +342,7 @@ class PlayState extends MusicBeatState
|
|||
|
||||
FlxG.camera.follow(camFollow, LOCKON, 0.04);
|
||||
// FlxG.camera.setScrollBounds(0, FlxG.width, 0, FlxG.height);
|
||||
FlxG.camera.zoom = 1.05;
|
||||
FlxG.camera.zoom = defaultCamZoom;
|
||||
|
||||
FlxG.worldBounds.set(0, 0, FlxG.width, FlxG.height);
|
||||
|
||||
|
@ -790,6 +845,11 @@ class PlayState extends MusicBeatState
|
|||
{
|
||||
camFollow.setPosition(boyfriend.getMidpoint().x - 100, boyfriend.getMidpoint().y - 100);
|
||||
|
||||
if (curStage == 'limo')
|
||||
{
|
||||
camFollow.x = boyfriend.getMidpoint().x - 300;
|
||||
}
|
||||
|
||||
if (SONG.song.toLowerCase() == 'tutorial')
|
||||
{
|
||||
FlxTween.tween(FlxG.camera, {zoom: 1}, (Conductor.stepCrochet * 4 / 1000), {ease: FlxEase.elasticInOut});
|
||||
|
@ -799,7 +859,7 @@ class PlayState extends MusicBeatState
|
|||
|
||||
if (camZooming)
|
||||
{
|
||||
FlxG.camera.zoom = FlxMath.lerp(1.05, FlxG.camera.zoom, 0.95);
|
||||
FlxG.camera.zoom = FlxMath.lerp(defaultCamZoom, FlxG.camera.zoom, 0.95);
|
||||
camHUD.zoom = FlxMath.lerp(1, camHUD.zoom, 0.95);
|
||||
}
|
||||
|
||||
|
@ -1003,6 +1063,7 @@ class PlayState extends MusicBeatState
|
|||
}
|
||||
else
|
||||
{
|
||||
trace('WENT BACK TO FREEPLAY??');
|
||||
FlxG.switchState(new FreeplayState());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -74,7 +74,9 @@ class TitleState extends MusicBeatState
|
|||
StoryMenuState.weekUnlocked[0] = true;
|
||||
}
|
||||
|
||||
#if SKIP_TO_PLAYSTATE
|
||||
#if FREEPLAY
|
||||
FlxG.switchState(new FreeplayState());
|
||||
#elseif CHARTING
|
||||
FlxG.switchState(new ChartingState());
|
||||
#else
|
||||
startIntro();
|
||||
|
|
Loading…
Reference in a new issue