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

stuff for week 7

This commit is contained in:
Cameron Taylor 2021-03-04 03:00:48 -05:00
parent 9b5802e1d0
commit 6d002a8ef8
4 changed files with 101 additions and 0 deletions

View file

@ -57,6 +57,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 +70,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="*.ogg" if="web"/>
@ -89,6 +91,8 @@
<assets path="assets/week5" library="week5" exclude="*.mp3" unless="web"/>
<assets path="assets/week6" library="week6" exclude="*.ogg" if="web"/>
<assets path="assets/week6" library="week6" exclude="*.mp3" unless="web"/>
<assets path="assets/week7" library="week7" exclude="*.ogg" if="web"/>
<assets path="assets/week7" library="week7" exclude="*.mp3" unless="web"/>
<assets path='example_mods' rename='mods' embed='false'/>
<assets path='art/readme.txt' rename='do NOT readme.txt' />

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");
}
}

View file

@ -495,6 +495,31 @@ 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);
animation.addByPrefix('singUP', 'Tankman UP note0', 24, false);
animation.addByPrefix('singDOWN', 'Tankman DOWN note0', 24, false);
animation.addByPrefix('singLEFT', 'Tankman Note Left0', 24, false);
animation.addByPrefix('singRIGHT', 'Tankman Right Note0', 24, false);
animation.addByPrefix('singUPmiss', 'Tankman UP note MISS', 24, false);
animation.addByPrefix('singDOWNmiss', 'Tankman DOWN note MISS', 24, false);
animation.addByPrefix('singLEFTmiss', 'Tankman Note Left MISS', 24, false);
animation.addByPrefix('singRIGHTmiss', 'Tankman Right Note MISS', 24, false);
addOffset('idle');
addOffset("singUP", 24, 56);
addOffset("singRIGHT", -1, -7);
addOffset("singLEFT", 100, -14);
addOffset("singDOWN", 98, -90);
addOffset("singUPmiss", 24, 56);
addOffset("singRIGHTmiss", -1, -7);
addOffset("singLEFTmiss", 100, -14);
addOffset("singDOWNmiss", 98, -90);
playAnim('idle');
flipX = true;
}
dance();
@ -522,6 +547,11 @@ class Character extends FlxSprite
}
}
private function loadOffsetFile(offsetCharacter:String)
{
var daFile:String = Paths.file("characters/" + offsetCharacter + "Offsets.txt");
}
override function update(elapsed:Float)
{
if (!curCharacter.startsWith('bf'))

View file

@ -75,6 +75,9 @@ 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