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

This commit is contained in:
MtH 2021-03-30 14:06:56 +02:00
commit 81ce710db6
12 changed files with 223 additions and 24 deletions

View File

@ -126,7 +126,7 @@
<haxelib name="faxe" if='switch'/>
<haxelib name="polymod"/>
<haxelib name="hxcpp-debug-server" if="desktop debug"/>
<haxelib name="discord_rpc" if="desktop"/>
<haxelib name="discord_rpc" if="cpp"/> <!-- foesn't work with neko -->
<!-- <haxelib name="hxcpp-debug-server" if="desktop"/> -->
<!-- <haxelib name="markdown" /> -->

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,65 @@
{"ATLAS": {"SPRITES":[
{"SPRITE" : {"name": "0000","x":1150,"y":0,"w":387,"h":220,"rotated": false}},
{"SPRITE" : {"name": "0001","x":399,"y":594,"w":194,"h":122,"rotated": false}},
{"SPRITE" : {"name": "0002","x":982,"y":700,"w":88,"h":148,"rotated": false}},
{"SPRITE" : {"name": "0003","x":210,"y":514,"w":184,"h":173,"rotated": false}},
{"SPRITE" : {"name": "0004","x":625,"y":548,"w":184,"h":173,"rotated": false}},
{"SPRITE" : {"name": "0005","x":1916,"y":649,"w":113,"h":152,"rotated": false}},
{"SPRITE" : {"name": "0006","x":1916,"y":492,"w":114,"h":152,"rotated": false}},
{"SPRITE" : {"name": "0007","x":982,"y":571,"w":40,"h":100,"rotated": false}},
{"SPRITE" : {"name": "0008","x":1295,"y":700,"w":121,"h":48,"rotated": false}},
{"SPRITE" : {"name": "0009","x":1421,"y":700,"w":122,"h":44,"rotated": false}},
{"SPRITE" : {"name": "0010","x":444,"y":721,"w":122,"h":42,"rotated": false}},
{"SPRITE" : {"name": "0011","x":814,"y":723,"w":97,"h":33,"rotated": false}},
{"SPRITE" : {"name": "0012","x":1599,"y":625,"w":97,"h":32,"rotated": false}},
{"SPRITE" : {"name": "0013","x":1599,"y":625,"w":97,"h":32,"rotated": false}},
{"SPRITE" : {"name": "0014","x":1490,"y":517,"w":97,"h":34,"rotated": false}},
{"SPRITE" : {"name": "0015","x":317,"y":721,"w":122,"h":44,"rotated": false}},
{"SPRITE" : {"name": "0016","x":1744,"y":439,"w":32,"h":19,"rotated": false}},
{"SPRITE" : {"name": "0017","x":1072,"y":570,"w":261,"h":125,"rotated": false}},
{"SPRITE" : {"name": "0018","x":1166,"y":700,"w":124,"h":68,"rotated": false}},
{"SPRITE" : {"name": "0019","x":1338,"y":570,"w":256,"h":125,"rotated": false}},
{"SPRITE" : {"name": "0020","x":1742,"y":662,"w":107,"h":154,"rotated": false}},
{"SPRITE" : {"name": "0021","x":1075,"y":700,"w":86,"h":145,"rotated": false}},
{"SPRITE" : {"name": "0022","x":285,"y":364,"w":116,"h":135,"rotated": false}},
{"SPRITE" : {"name": "0023","x":2036,"y":0,"w":1,"h":4,"rotated": false}},
{"SPRITE" : {"name": "0024","x":835,"y":0,"w":310,"h":377,"rotated": false}},
{"SPRITE" : {"name": "0025","x":192,"y":692,"w":120,"h":119,"rotated": false}},
{"SPRITE" : {"name": "0026","x":424,"y":363,"w":196,"h":226,"rotated": false}},
{"SPRITE" : {"name": "0027","x":1599,"y":662,"w":138,"h":130,"rotated": false}},
{"SPRITE" : {"name": "0028","x":868,"y":382,"w":199,"h":184,"rotated": false}},
{"SPRITE" : {"name": "0029","x":625,"y":382,"w":238,"h":161,"rotated": false}},
{"SPRITE" : {"name": "0030","x":0,"y":364,"w":280,"h":145,"rotated": false}},
{"SPRITE" : {"name": "0031","x":1795,"y":0,"w":236,"h":241,"rotated": false}},
{"SPRITE" : {"name": "0032","x":814,"y":571,"w":163,"h":147,"rotated": false}},
{"SPRITE" : {"name": "0033","x":1542,"y":0,"w":248,"h":267,"rotated": false}},
{"SPRITE" : {"name": "0034","x":1072,"y":395,"w":204,"h":170,"rotated": false}},
{"SPRITE" : {"name": "0035","x":1281,"y":395,"w":204,"h":170,"rotated": false}},
{"SPRITE" : {"name": "0036","x":1709,"y":492,"w":202,"h":165,"rotated": false}},
{"SPRITE" : {"name": "0037","x":0,"y":514,"w":205,"h":162,"rotated": false}},
{"SPRITE" : {"name": "0038","x":1491,"y":225,"w":40,"h":34,"rotated": false}},
{"SPRITE" : {"name": "0039","x":1854,"y":662,"w":51,"h":62,"rotated": false}},
{"SPRITE" : {"name": "0040","x":1709,"y":272,"w":65,"h":79,"rotated": false}},
{"SPRITE" : {"name": "0041","x":1709,"y":356,"w":53,"h":78,"rotated": false}},
{"SPRITE" : {"name": "0042","x":571,"y":721,"w":47,"h":64,"rotated": false}},
{"SPRITE" : {"name": "0043","x":1709,"y":439,"w":30,"h":42,"rotated": false}},
{"SPRITE" : {"name": "0044","x":2015,"y":246,"w":23,"h":36,"rotated": false}},
{"SPRITE" : {"name": "0045","x":2015,"y":287,"w":20,"h":31,"rotated": false}},
{"SPRITE" : {"name": "0046","x":2015,"y":323,"w":17,"h":22,"rotated": false}},
{"SPRITE" : {"name": "0047","x":0,"y":681,"w":187,"h":90,"rotated": false}},
{"SPRITE" : {"name": "0048","x":0,"y":0,"w":419,"h":359,"rotated": false}},
{"SPRITE" : {"name": "0049","x":424,"y":0,"w":406,"h":358,"rotated": false}},
{"SPRITE" : {"name": "0050","x":1150,"y":225,"w":336,"h":165,"rotated": false}},
{"SPRITE" : {"name": "0051","x":1599,"y":517,"w":90,"h":103,"rotated": false}},
{"SPRITE" : {"name": "0052","x":1795,"y":246,"w":215,"h":241,"rotated": false}},
{"SPRITE" : {"name": "0053","x":1491,"y":272,"w":213,"h":240,"rotated": false}}
]},
"meta": {
"app": "Adobe Animate",
"version": "21.0.4.39603",
"image": "spritemap1.png",
"format": "RGBA8888",
"size": {"w":2038,"h":848},
"resolution": "1"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 313 KiB

View File

@ -1,5 +1,6 @@
package;
import Section.SwagSection;
import flixel.FlxG;
import flixel.FlxSprite;
import flixel.animation.FlxBaseAnimation;
@ -18,6 +19,8 @@ class Character extends FlxSprite
public var holdTimer:Float = 0;
public var animationNotes:Array<Dynamic> = [];
public function new(x:Float, y:Float, ?character:String = "bf", ?isPlayer:Bool = false)
{
super(x, y);
@ -291,6 +294,8 @@ class Character extends FlxSprite
loadOffsetFile(curCharacter);
playAnim('shoot1');
loadMappedAnims();
case 'bf':
var tex = Paths.getSparrowAtlas('characters/BOYFRIEND');
frames = tex;
@ -575,6 +580,23 @@ class Character extends FlxSprite
}
}
public function loadMappedAnims()
{
var swagshit = Song.loadFromJson('picospeaker', 'stress');
var notes = swagshit.notes;
for (section in notes)
{
for (idk in section.sectionNotes)
{
animationNotes.push(idk);
}
}
trace(animationNotes);
}
function quickAnimAdd(name:String, prefix:String)
{
animation.addByPrefix(name, prefix, 24, false);
@ -623,6 +645,25 @@ class Character extends FlxSprite
case 'gf':
if (animation.curAnim.name == 'hairFall' && animation.curAnim.finished)
playAnim('danceRight');
case "pico-speaker":
// for pico??
if (animationNotes.length > 0)
{
if (Conductor.songPosition > animationNotes[0][0])
{
trace('played shoot anim' + animationNotes[0][1]);
var shootAnim:Int = 1;
if (animationNotes[0][1] >= 2)
shootAnim = 3;
shootAnim += FlxG.random.int(0, 1);
playAnim('shoot' + shootAnim, true);
animationNotes.shift();
}
}
}
super.update(elapsed);
@ -651,7 +692,8 @@ class Character extends FlxSprite
}
case 'pico-speaker':
playAnim('shoot' + FlxG.random.int(1, 4), true);
// lol weed
// playAnim('shoot' + FlxG.random.int(1, 4), true);
case 'spooky':
danced = !danced;

View File

@ -1,6 +1,5 @@
package;
#if desktop
#if discord_rpc
import Discord.DiscordClient;
#end
import flash.text.TextField;
@ -52,7 +51,7 @@ class FreeplayState extends MusicBeatState
FlxG.sound.playMusic(Paths.music('freakyMenu'));
}
#if desktop
#if discord_rpc
// Updating Discord Rich Presence
DiscordClient.changePresence("In the Menus", null);
#end

View File

@ -41,7 +41,7 @@ class MainMenuState extends MusicBeatState
override function create()
{
#if desktop
#if discord_rpc
// Updating Discord Rich Presence
DiscordClient.changePresence("In the Menus", null);
#end

View File

@ -43,7 +43,7 @@ import ui.PreferencesMenu;
using StringTools;
#if desktop
#if discord_rpc
import Discord.DiscordClient;
#end
@ -134,7 +134,7 @@ class PlayState extends MusicBeatState
var inCutscene:Bool = false;
#if desktop
#if discord_rpc
// Discord RPC variables
var storyDifficultyText:String = "";
var iconRPC:String = "";
@ -710,7 +710,7 @@ class PlayState extends MusicBeatState
// startCountdown();
generateSong(SONG.song);
generateSong();
// add(strumLine);
@ -833,7 +833,7 @@ class PlayState extends MusicBeatState
function initDiscord():Void
{
#if desktop
#if discord_rpc
storyDifficultyText = CoolUtil.difficultyString();
iconRPC = SONG.player2;
@ -1072,7 +1072,7 @@ class PlayState extends MusicBeatState
FlxG.sound.music.onComplete = endSong;
vocals.play();
#if desktop
#if discord_rpc
// Song duration in a float, useful for the time left feature
songLength = FlxG.sound.music.length;
@ -1083,7 +1083,7 @@ class PlayState extends MusicBeatState
var debugNum:Int = 0;
private function generateSong(dataPath:String):Void
private function generateSong():Void
{
// FlxG.log.add(ChartParser.parse());
@ -1323,7 +1323,7 @@ class PlayState extends MusicBeatState
startTimer.active = true;
paused = false;
#if desktop
#if discord_rpc
if (startTimer.finished)
{
DiscordClient.changePresence(detailsText, SONG.song + " (" + storyDifficultyText + ")", iconRPC, true, songLength - Conductor.songPosition);
@ -1338,9 +1338,9 @@ class PlayState extends MusicBeatState
super.closeSubState();
}
#if discord_rpc
override public function onFocus():Void
{
#if desktop
if (health > 0 && !paused)
{
if (Conductor.songPosition > 0.0)
@ -1352,22 +1352,20 @@ class PlayState extends MusicBeatState
DiscordClient.changePresence(detailsText, SONG.song + " (" + storyDifficultyText + ")", iconRPC);
}
}
#end
super.onFocus();
}
override public function onFocusLost():Void
{
#if desktop
if (health > 0 && !paused)
{
DiscordClient.changePresence(detailsPausedText, SONG.song + " (" + storyDifficultyText + ")", iconRPC);
}
#end
super.onFocusLost();
}
#end
function resyncVocals():Void
{
@ -1469,7 +1467,7 @@ class PlayState extends MusicBeatState
boyfriendPos.put();
}
#if desktop
#if discord_rpc
DiscordClient.changePresence(detailsPausedText, SONG.song + " (" + storyDifficultyText + ")", iconRPC);
#end
}
@ -1478,7 +1476,7 @@ class PlayState extends MusicBeatState
{
FlxG.switchState(new ChartingState());
#if desktop
#if discord_rpc
DiscordClient.changePresence("Chart Editor", null, null, true);
#end
}
@ -1597,7 +1595,7 @@ class PlayState extends MusicBeatState
// FlxG.switchState(new GameOverState(boyfriend.getScreenPosition().x, boyfriend.getScreenPosition().y));
#if desktop
#if discord_rpc
// Game Over doesn't get his own variable because it's only used here
DiscordClient.changePresence("Game Over - " + detailsText, SONG.song + " (" + storyDifficultyText + ")", iconRPC);
#end

View File

@ -1,6 +1,6 @@
package;
#if desktop
#if discord_rpc
import Discord.DiscordClient;
#end
import flixel.FlxG;
@ -113,7 +113,7 @@ class StoryMenuState extends MusicBeatState
trace("Line 70");
#if desktop
#if discord_rpc
// Updating Discord Rich Presence
DiscordClient.changePresence("In the Menus", null);
#end

View File

@ -1,5 +1,6 @@
package;
import animate.AnimationAtlas;
import flixel.FlxG;
import flixel.FlxSprite;
import flixel.addons.transition.FlxTransitionSprite.GraphicTransTileDiamond;
@ -21,8 +22,10 @@ import ui.PreferencesMenu;
using StringTools;
#if desktop
#if discord_rpc
import Discord.DiscordClient;
#end
#if desktop
import sys.thread.Thread;
#end
@ -50,6 +53,8 @@ class TitleState extends MusicBeatState
polymod.Polymod.init({modRoot: "mods", dirs: ['introMod'], framework: OPENFL});
#end
AnimationAtlas.fromAnimate(Paths.image('money'), Paths.file('images/money.json'));
swagShader = new ColorSwap();
FlxG.sound.muteKeys = [ZERO];
@ -95,7 +100,7 @@ class TitleState extends MusicBeatState
});
#end
#if desktop
#if discord_rpc
DiscordClient.initialize();
#end
}

View File

@ -0,0 +1,11 @@
package animate;
import flixel.group.FlxGroup;
class Aniamtion extends FlxGroup
{
public function new(symbolName:String, atlas:AnimationAtlas):Void
{
super();
}
}

View File

@ -0,0 +1,78 @@
package animate;
import flixel.FlxG;
import flixel.addons.ui.FlxUIColorSwatchSelecter.SwatchGraphic;
import flixel.graphics.FlxGraphic;
import flixel.graphics.frames.FlxAtlasFrames;
import flixel.math.FlxPoint;
import flixel.math.FlxRect;
import flixel.system.FlxAssets.FlxGraphicAsset;
import haxe.Json;
import openfl.Assets;
import openfl.geom.Rectangle;
class AnimationAtlas
{
public function new(data:Dynamic, atlas:FlxAtlasFrames):Void {}
public static function fromAnimate(Source:FlxGraphicAsset, Description:String):FlxAtlasFrames
{
var graphic:FlxGraphic = FlxG.bitmap.add(Source);
if (graphic == null)
return null;
var frames:FlxAtlasFrames = FlxAtlasFrames.findFrame(graphic);
if (frames != null)
return frames;
if (graphic == null || Description == null)
return null;
frames = new FlxAtlasFrames(graphic);
var data:AnimateObject;
var json:String = Description;
trace(json);
if (Assets.exists(json))
json = Assets.getText(json);
trace(json);
data = cast Json.parse(json).ATLAS;
for (sprite in data.SPRITES)
{
// probably nicer way to do this? Oh well
var swagSprite:AnimateSprite = sprite.SPRITE;
var rect = FlxRect.get(swagSprite.x, swagSprite.y, swagSprite.w, swagSprite.h);
var size = new Rectangle(0, 0, rect.width, rect.height);
var offset = FlxPoint.get(-size.left, -size.top);
var sourceSize = FlxPoint.get(size.width, size.height);
frames.addAtlasFrame(rect, sourceSize, offset, swagSprite.name);
}
return frames;
}
}
typedef AnimateObject =
{
SPRITES:Array<Dynamic>
}
typedef AnimateSprite =
{
var name:String;
var x:Int;
var y:Int;
var w:Int;
var h:Int;
var rotated:Bool;
}