Merge branch 'master' of github.com:ninjamuffin99/Funkin-secret into nitpix

This commit is contained in:
MtH 2021-03-22 01:55:17 +01:00
commit bb663f7c19
15 changed files with 171 additions and 135 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

Before

Width:  |  Height:  |  Size: 696 KiB

After

Width:  |  Height:  |  Size: 696 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 549 KiB

View File

@ -1,92 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<TextureAtlas imagePath="NOTE_assets_desat.png">
<!-- Created with Adobe Animate version 21.0.0.35450 -->
<!-- http://www.adobe.com/products/animate.html -->
<SubTexture name="arrow static instance 10000" x="496" y="244" width="155" height="158"/>
<SubTexture name="arrow static instance 20000" x="661" y="244" width="157" height="155"/>
<SubTexture name="arrow static instance 30000" x="0" y="246" width="155" height="157"/>
<SubTexture name="arrow static instance 40000" x="165" y="410" width="157" height="154"/>
<SubTexture name="blue hold end instance 10000" x="1938" y="0" width="51" height="64"/>
<SubTexture name="blue hold piece instance 10000" x="1938" y="202" width="51" height="44"/>
<SubTexture name="blue instance 10000" x="165" y="246" width="158" height="154"/>
<SubTexture name="down confirm instance 10000" x="0" y="0" width="238" height="236"/>
<SubTexture name="down confirm instance 10001" x="248" y="0" width="238" height="236"/>
<SubTexture name="down confirm instance 10002" x="1230" y="241" width="222" height="218" frameX="-5" frameY="-12" frameWidth="238" frameHeight="236"/>
<SubTexture name="down confirm instance 10003" x="1230" y="241" width="222" height="218" frameX="-5" frameY="-12" frameWidth="238" frameHeight="236"/>
<SubTexture name="down press instance 10000" x="1296" y="469" width="142" height="140" frameX="-4" frameY="-3" frameWidth="149" frameHeight="147"/>
<SubTexture name="down press instance 10001" x="1296" y="469" width="142" height="140" frameX="-4" frameY="-3" frameWidth="149" frameHeight="147"/>
<SubTexture name="down press instance 10002" x="0" y="413" width="149" height="147"/>
<SubTexture name="down press instance 10003" x="0" y="413" width="149" height="147"/>
<SubTexture name="green hold end instance 10000" x="1938" y="0" width="51" height="64"/>
<SubTexture name="green hold piece instance 10000" x="1938" y="148" width="51" height="44"/>
<SubTexture name="green instance 10000" x="661" y="409" width="157" height="154"/>
<SubTexture name="left confirm instance 10000" x="992" y="0" width="228" height="232"/>
<SubTexture name="left confirm instance 10001" x="1468" y="239" width="219" height="222" frameX="-4" frameY="-5" frameWidth="228" frameHeight="232"/>
<SubTexture name="left confirm instance 10002" x="1468" y="0" width="225" height="229" frameX="-2" frameY="-1" frameWidth="228" frameHeight="232"/>
<SubTexture name="left confirm instance 10003" x="1468" y="0" width="225" height="229" frameX="-2" frameY="-1" frameWidth="228" frameHeight="232"/>
<SubTexture name="left press instance 10000" x="1146" y="469" width="140" height="143" frameX="-4" frameY="-3" frameWidth="147" frameHeight="150"/>
<SubTexture name="left press instance 10001" x="1146" y="469" width="140" height="143" frameX="-4" frameY="-3" frameWidth="147" frameHeight="150"/>
<SubTexture name="left press instance 10002" x="496" y="412" width="147" height="150"/>
<SubTexture name="left press instance 10003" x="496" y="412" width="147" height="150"/>
<SubTexture name="left press instance 10004" x="496" y="412" width="147" height="150"/>
<SubTexture name="left press instance 10005" x="496" y="412" width="147" height="150"/>
<SubTexture name="left press instance 10006" x="496" y="412" width="147" height="150"/>
<SubTexture name="left press instance 10007" x="496" y="412" width="147" height="150"/>
<SubTexture name="left press instance 10008" x="496" y="412" width="147" height="150"/>
<SubTexture name="left press instance 10009" x="496" y="412" width="147" height="150"/>
<SubTexture name="left press instance 10010" x="496" y="412" width="147" height="150"/>
<SubTexture name="left press instance 10011" x="496" y="412" width="147" height="150"/>
<SubTexture name="left press instance 10012" x="496" y="412" width="147" height="150"/>
<SubTexture name="left press instance 10013" x="496" y="412" width="147" height="150"/>
<SubTexture name="left press instance 10014" x="496" y="412" width="147" height="150"/>
<SubTexture name="left press instance 10015" x="496" y="412" width="147" height="150"/>
<SubTexture name="left press instance 10016" x="496" y="412" width="147" height="150"/>
<SubTexture name="left press instance 10017" x="496" y="412" width="147" height="150"/>
<SubTexture name="left press instance 10018" x="496" y="412" width="147" height="150"/>
<SubTexture name="left press instance 10019" x="496" y="412" width="147" height="150"/>
<SubTexture name="pruple end hold instance 10000" x="1938" y="74" width="51" height="64"/>
<SubTexture name="purple hold piece instance 10000" x="1938" y="256" width="51" height="44"/>
<SubTexture name="purple instance 10000" x="332" y="410" width="154" height="157"/>
<SubTexture name="red hold end instance 10000" x="1938" y="0" width="51" height="64"/>
<SubTexture name="red hold piece instance 10000" x="1938" y="148" width="51" height="44"/>
<SubTexture name="red instance 10000" x="828" y="244" width="154" height="157"/>
<SubTexture name="right confirm instance 10000" x="1703" y="0" width="225" height="228" frameX="-1" frameY="-2" frameWidth="228" frameHeight="231"/>
<SubTexture name="right confirm instance 10001" x="1703" y="238" width="225" height="228" frameX="-1" frameY="-2" frameWidth="228" frameHeight="231"/>
<SubTexture name="right confirm instance 10002" x="1230" y="0" width="228" height="231"/>
<SubTexture name="right confirm instance 10003" x="1230" y="0" width="228" height="231"/>
<SubTexture name="right press instance 10000" x="1448" y="471" width="138" height="141" frameX="-3" frameY="-7" frameWidth="148" frameHeight="151"/>
<SubTexture name="right press instance 10001" x="1448" y="471" width="138" height="141" frameX="-3" frameY="-7" frameWidth="148" frameHeight="151"/>
<SubTexture name="right press instance 10002" x="333" y="246" width="148" height="151"/>
<SubTexture name="right press instance 10003" x="333" y="246" width="148" height="151"/>
<SubTexture name="right press instance 10004" x="333" y="246" width="148" height="151"/>
<SubTexture name="right press instance 10005" x="333" y="246" width="148" height="151"/>
<SubTexture name="right press instance 10006" x="333" y="246" width="148" height="151"/>
<SubTexture name="right press instance 10007" x="333" y="246" width="148" height="151"/>
<SubTexture name="right press instance 10008" x="333" y="246" width="148" height="151"/>
<SubTexture name="right press instance 10009" x="333" y="246" width="148" height="151"/>
<SubTexture name="right press instance 10010" x="333" y="246" width="148" height="151"/>
<SubTexture name="right press instance 10011" x="333" y="246" width="148" height="151"/>
<SubTexture name="right press instance 10012" x="333" y="246" width="148" height="151"/>
<SubTexture name="right press instance 10013" x="333" y="246" width="148" height="151"/>
<SubTexture name="right press instance 10014" x="333" y="246" width="148" height="151"/>
<SubTexture name="right press instance 10015" x="333" y="246" width="148" height="151"/>
<SubTexture name="right press instance 10016" x="333" y="246" width="148" height="151"/>
<SubTexture name="right press instance 10017" x="333" y="246" width="148" height="151"/>
<SubTexture name="right press instance 10018" x="333" y="246" width="148" height="151"/>
<SubTexture name="right press instance 10019" x="333" y="246" width="148" height="151"/>
<SubTexture name="right press instance 10020" x="333" y="246" width="148" height="151"/>
<SubTexture name="right press instance 10021" x="333" y="246" width="148" height="151"/>
<SubTexture name="right press instance 10022" x="333" y="246" width="148" height="151"/>
<SubTexture name="right press instance 10023" x="333" y="246" width="148" height="151"/>
<SubTexture name="right press instance 10024" x="333" y="246" width="148" height="151"/>
<SubTexture name="right press instance 10025" x="333" y="246" width="148" height="151"/>
<SubTexture name="right press instance 10026" x="333" y="246" width="148" height="151"/>
<SubTexture name="up confirm instance 10000" x="496" y="0" width="238" height="234"/>
<SubTexture name="up confirm instance 10001" x="744" y="0" width="238" height="234"/>
<SubTexture name="up confirm instance 10002" x="992" y="242" width="216" height="213" frameX="-11" frameY="-11" frameWidth="238" frameHeight="234"/>
<SubTexture name="up confirm instance 10003" x="992" y="242" width="216" height="213" frameX="-11" frameY="-11" frameWidth="238" frameHeight="234"/>
<SubTexture name="up press instance 10000" x="992" y="465" width="144" height="141" frameX="-5" frameY="-4" frameWidth="154" frameHeight="150"/>
<SubTexture name="up press instance 10001" x="992" y="465" width="144" height="141" frameX="-5" frameY="-4" frameWidth="154" frameHeight="150"/>
<SubTexture name="up press instance 10002" x="828" y="411" width="154" height="150"/>
<SubTexture name="up press instance 10003" x="828" y="411" width="154" height="150"/>
</TextureAtlas>

View File

@ -0,0 +1,63 @@
package;
import flixel.FlxG;
import flixel.group.FlxGroup.FlxTypedGroup;
import shaderslmfao.ColorSwap;
class ColorpickSubstate extends MusicBeatSubstate
{
var curSelected:Int = 0;
var grpNotes:FlxTypedGroup<Note>;
public function new()
{
super();
grpNotes = new FlxTypedGroup<Note>();
add(grpNotes);
for (i in 0...4)
{
var note:Note = new Note(0, i);
note.x = (100 * i) + i;
note.screenCenter(Y);
grpNotes.add(note);
}
}
override function update(elapsed:Float)
{
if (controls.BACK)
{
FlxG.state.closeSubState();
FlxG.state.openSubState(new OptionsSubState());
}
if (controls.RIGHT_P)
curSelected += 1;
if (controls.LEFT_P)
curSelected -= 1;
if (curSelected < 0)
curSelected = grpNotes.members.length - 1;
if (curSelected >= grpNotes.members.length)
curSelected = 0;
if (controls.UP)
{
grpNotes.members[curSelected].colorSwap.update(elapsed * 0.3);
Note.arrowColors[curSelected] += elapsed * 0.3;
}
if (controls.DOWN)
{
grpNotes.members[curSelected].colorSwap.update(-elapsed * 0.3);
Note.arrowColors[curSelected] += -elapsed * 0.3;
}
super.update(elapsed);
}
}

View File

@ -28,6 +28,7 @@ class Note extends FlxSprite
public var sustainLength:Float = 0;
public var isSustainNote:Bool = false;
public var colorSwap:ColorSwap;
public var noteScore:Float = 1;
public static var swagWidth:Float = 160 * 0.7;
@ -36,6 +37,8 @@ class Note extends FlxSprite
public static var BLUE_NOTE:Int = 1;
public static var RED_NOTE:Int = 3;
public static var arrowColors:Array<Float> = [1, 1, 1, 1];
public function new(strumTime:Float, noteData:Int, ?prevNote:Note, ?sustainNote:Bool = false)
{
super();
@ -105,10 +108,6 @@ class Note extends FlxSprite
updateHitbox();
antialiasing = true;
var colorSwap = new ColorSwap();
// shader = colorSwap.shader;
// colorSwap.colorToReplace = 0xFFF9393F;
// colorSwap.newColor = 0xFF00FF00;
@ -117,11 +116,16 @@ class Note extends FlxSprite
// replaceColor(0xFFC1C1C1, FlxColor.RED);
}
colorSwap = new ColorSwap();
shader = colorSwap.shader;
updateColors();
switch (noteData)
{
case 0:
x += swagWidth * 0;
animation.play('purpleScroll');
case 1:
x += swagWidth * 1;
animation.play('blueScroll');
@ -182,6 +186,11 @@ class Note extends FlxSprite
}
}
public function updateColors():Void
{
colorSwap.update(arrowColors[noteData]);
}
override function update(elapsed:Float)
{
super.update(elapsed);

View File

@ -8,7 +8,7 @@ import flixel.util.FlxColor;
class OptionsSubState extends MusicBeatSubstate
{
var textMenuItems:Array<String> = ['Master Volume', 'Sound Volume', 'Controls'];
var textMenuItems:Array<String> = ['Master Volume', 'Sound Volume', 'Controls', 'Colors', 'Back'];
var selector:FlxSprite;
var curSelected:Int = 0;
@ -63,16 +63,24 @@ class OptionsSubState extends MusicBeatSubstate
txt.color = FlxColor.YELLOW;
});
if (controls.BACK)
FlxG.switchState(new MainMenuState());
if (controls.ACCEPT)
{
switch (textMenuItems[curSelected])
{
case "Colors":
FlxG.state.closeSubState();
FlxG.state.openSubState(new ColorpickSubstate());
case "Controls":
FlxG.state.closeSubState();
FlxG.state.openSubState(new ControlsSubState());
case "Mods":
FlxG.state.closeSubState();
FlxG.state.openSubState(new ModdingSubstate());
case "Back":
FlxG.switchState(new MainMenuState());
}
}
}

View File

@ -1,8 +1,5 @@
package;
#if desktop
import Discord.DiscordClient;
#end
import Section.SwagSection;
import Song.SwagSong;
import WiggleEffect.WiggleEffectType;
@ -41,9 +38,14 @@ import lime.utils.Assets;
import openfl.display.BlendMode;
import openfl.display.StageQuality;
import openfl.filters.ShaderFilter;
import shaderslmfao.ColorSwap;
using StringTools;
#if desktop
import Discord.DiscordClient;
#end
class PlayState extends MusicBeatState
{
public static var curStage:String = '';
@ -1188,6 +1190,9 @@ class PlayState extends MusicBeatState
{
// FlxG.log.add(i);
var babyArrow:FlxSprite = new FlxSprite(0, strumLine.y);
var colorswap:ColorSwap = new ColorSwap();
babyArrow.shader = colorswap.shader;
colorswap.update(Note.arrowColors[i]);
switch (curStage)
{
@ -2006,8 +2011,11 @@ class PlayState extends MusicBeatState
var controlArray:Array<Bool> = [leftP, downP, upP, rightP];
// FlxG.watch.addQuick('asdfa', upP);
if ((upP || rightP || downP || leftP) && !boyfriend.stunned && generatedMusic)
if ((upP || rightP || downP || leftP) && generatedMusic)
{
// note to self, used to have stunned
// && !boyfriend.stunned
boyfriend.holdTimer = 0;
var possibleNotes:Array<Note> = [];

View File

@ -1,9 +1,5 @@
package;
#if desktop
import Discord.DiscordClient;
import sys.thread.Thread;
#end
import flixel.FlxG;
import flixel.FlxSprite;
import flixel.addons.transition.FlxTransitionSprite.GraphicTransTileDiamond;
@ -21,9 +17,15 @@ import flixel.util.FlxTimer;
import io.newgrounds.NG;
import lime.app.Application;
import openfl.Assets;
import shaderslmfao.ColorSwap;
using StringTools;
#if desktop
import Discord.DiscordClient;
import sys.thread.Thread;
#end
class TitleState extends MusicBeatState
{
static var initialized:Bool = false;
@ -40,12 +42,16 @@ class TitleState extends MusicBeatState
var lastBeat:Int = 0;
var swagShader:ColorSwap;
override public function create():Void
{
#if polymod
polymod.Polymod.init({modRoot: "mods", dirs: ['introMod'], framework: OPENFL});
#end
swagShader = new ColorSwap();
FlxG.sound.muteKeys = [ZERO];
PlayerSettings.init();
@ -148,6 +154,8 @@ class TitleState extends MusicBeatState
logoBl.animation.play('bump');
logoBl.updateHitbox();
logoBl.shader = swagShader.shader;
// trace();
// logoBl.screenCenter();
// logoBl.color = FlxColor.BLACK;
@ -158,6 +166,9 @@ class TitleState extends MusicBeatState
gfDance.animation.addByIndices('danceRight', 'gfDance', [15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29], "", 24, false);
gfDance.antialiasing = true;
add(gfDance);
gfDance.shader = swagShader.shader;
add(logoBl);
titleText = new FlxSprite(100, FlxG.height * 0.8);
@ -322,6 +333,16 @@ class TitleState extends MusicBeatState
skipIntro();
}
if (controls.LEFT)
{
swagShader.update(-elapsed * 0.1);
}
if (controls.RIGHT)
{
swagShader.update(elapsed * 0.1);
}
super.update(elapsed);
}
@ -355,6 +376,8 @@ class TitleState extends MusicBeatState
}
}
var isRainbow:Bool = false;
override function beatHit()
{
super.beatHit();

View File

@ -8,33 +8,39 @@ class ColorSwap
public var shader(default, null):ColorSwapShader;
public var colorToReplace(default, set):FlxColor;
public var newColor(default, set):FlxColor;
public var daTime(default, set):Float;
public var hueShit:Float = 0;
public function new():Void
{
shader = new ColorSwapShader();
shader.colorOld.value = [];
shader.colorNew.value = [];
shader.uTime.value = [0];
shader.money.value = [0];
}
public function update(elapsed:Float):Void
{
shader.uTime.value[0] += elapsed;
hueShit += elapsed;
// trace(shader.money.value[0]);
}
function set_colorToReplace(color:FlxColor):FlxColor
{
colorToReplace = color;
shader.colorOld.value[0] = color.red;
shader.colorOld.value[1] = color.green;
shader.colorOld.value[2] = color.blue;
return color;
}
function set_daTime(daTime:Float):Float
{
return daTime;
}
function set_newColor(color:FlxColor):FlxColor
{
newColor = color;
shader.colorNew.value[0] = color.red;
shader.colorNew.value[1] = color.green;
shader.colorNew.value[2] = color.blue;
return color;
}
}
@ -44,9 +50,8 @@ class ColorSwapShader extends FlxShader
@:glFragmentSource('
#pragma header
uniform vec3 colorOld;
uniform vec3 colorNew;
uniform float u_time;
uniform float uTime;
uniform float money;
vec3 normalizeColor(vec3 color)
{
@ -57,29 +62,39 @@ class ColorSwapShader extends FlxShader
);
}
vec3 hueShift(vec3 color, float hue) {
const vec3 k = vec3(0.57735, 0.57735, 0.57735);
float cosAngle = cos(hue);
return vec3(color * cosAngle + cross(k, color) * sin(hue) + k * dot(k, color) * (1.0 - cosAngle));
vec3 rgb2hsv(vec3 c)
{
vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g));
vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r));
float d = q.x - min(q.w, q.y);
float e = 1.0e-10;
return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);
}
vec3 hsv2rgb(vec3 c)
{
vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
}
void main()
{
vec4 pixel = texture2D(bitmap, openfl_TextureCoordv);
vec4 color = flixel_texture2D(bitmap, openfl_TextureCoordv);
vec3 eps = vec3(0.02, 0.02, 0.02);
vec4 swagColor = vec4(rgb2hsv(vec3(color[0], color[1], color[2])), color[3]);
// [0] is the hue???
swagColor[0] += uTime;
// swagColor[1] += uTime;
vec3 colorOldNormalized = normalizeColor(colorOld);
vec3 colorNewNormalized = normalizeColor(colorNew);
// money += swagColor[0];
if (all(greaterThanEqual(pixel, vec4(colorOldNormalized - eps, 1.0)) ) && all(lessThanEqual(pixel, vec4(colorOldNormalized + eps, 1.0)) )
)
{
pixel = vec4(hueShift(colorOldNormalized, 0.7), 1.0);
}
color = vec4(hsv2rgb(vec3(swagColor[0], swagColor[1], swagColor[2])), swagColor[3]);
gl_FragColor = pixel;
gl_FragColor = color;
}
')