mirror of
https://github.com/ninjamuffin99/Funkin.git
synced 2025-04-01 15:25:25 +00:00
offset bullshit and pico
This commit is contained in:
parent
388a3f8aab
commit
15f7b5e2d2
|
@ -4,6 +4,7 @@ import flixel.FlxG;
|
||||||
import flixel.FlxSprite;
|
import flixel.FlxSprite;
|
||||||
import flixel.animation.FlxBaseAnimation;
|
import flixel.animation.FlxBaseAnimation;
|
||||||
import flixel.graphics.frames.FlxAtlasFrames;
|
import flixel.graphics.frames.FlxAtlasFrames;
|
||||||
|
import haxe.io.Path;
|
||||||
|
|
||||||
using StringTools;
|
using StringTools;
|
||||||
|
|
||||||
|
@ -266,6 +267,18 @@ class Character extends FlxSprite
|
||||||
|
|
||||||
flipX = true;
|
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':
|
case 'bf':
|
||||||
var tex = Paths.getSparrowAtlas('BOYFRIEND');
|
var tex = Paths.getSparrowAtlas('BOYFRIEND');
|
||||||
frames = tex;
|
frames = tex;
|
||||||
|
@ -521,15 +534,7 @@ class Character extends FlxSprite
|
||||||
animation.addByPrefix('singUPmiss', 'Tankman UP note MISS', 24, false);
|
animation.addByPrefix('singUPmiss', 'Tankman UP note MISS', 24, false);
|
||||||
animation.addByPrefix('singDOWNmiss', 'Tankman DOWN note MISS', 24, false);
|
animation.addByPrefix('singDOWNmiss', 'Tankman DOWN note MISS', 24, false);
|
||||||
|
|
||||||
addOffset('idle');
|
loadOffsetFile(curCharacter);
|
||||||
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');
|
playAnim('idle');
|
||||||
|
|
||||||
|
@ -561,9 +566,20 @@ class Character extends FlxSprite
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function quickAnimAdd(name:String, prefix:String)
|
||||||
|
{
|
||||||
|
animation.addByPrefix(name, prefix, 24, false);
|
||||||
|
}
|
||||||
|
|
||||||
private function loadOffsetFile(offsetCharacter:String)
|
private function loadOffsetFile(offsetCharacter:String)
|
||||||
{
|
{
|
||||||
var daFile:String = Paths.file("characters/" + offsetCharacter + "Offsets.txt");
|
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)
|
override function update(elapsed:Float)
|
||||||
|
@ -649,6 +665,8 @@ class Character extends FlxSprite
|
||||||
else
|
else
|
||||||
playAnim('danceLeft');
|
playAnim('danceLeft');
|
||||||
}
|
}
|
||||||
|
case 'pico-speaker':
|
||||||
|
playAnim('shoot' + FlxG.random.int(1, 4), true);
|
||||||
|
|
||||||
case 'spooky':
|
case 'spooky':
|
||||||
danced = !danced;
|
danced = !danced;
|
||||||
|
|
|
@ -21,6 +21,7 @@ class HealthIcon extends FlxSprite
|
||||||
animation.add('bf-pixel', [21, 21], 0, false, isPlayer);
|
animation.add('bf-pixel', [21, 21], 0, false, isPlayer);
|
||||||
animation.add('spooky', [2, 3], 0, false, isPlayer);
|
animation.add('spooky', [2, 3], 0, false, isPlayer);
|
||||||
animation.add('pico', [4, 5], 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', [6, 7], 0, false, isPlayer);
|
||||||
animation.add('mom-car', [6, 7], 0, false, isPlayer);
|
animation.add('mom-car', [6, 7], 0, false, isPlayer);
|
||||||
animation.add('tankman', [8, 9], 0, false, isPlayer);
|
animation.add('tankman', [8, 9], 0, false, isPlayer);
|
||||||
|
|
|
@ -560,9 +560,19 @@ class PlayState extends MusicBeatState
|
||||||
if (curStage == 'limo')
|
if (curStage == 'limo')
|
||||||
gfVersion = 'gf-car';
|
gfVersion = 'gf-car';
|
||||||
|
|
||||||
|
if (SONG.song.toLowerCase() == 'stress')
|
||||||
|
gfVersion = 'pico-speaker';
|
||||||
|
|
||||||
gf = new Character(400, 130, gfVersion);
|
gf = new Character(400, 130, gfVersion);
|
||||||
gf.scrollFactor.set(0.95, 0.95);
|
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);
|
dad = new Character(100, 100, SONG.player2);
|
||||||
|
|
||||||
var camPos:FlxPoint = new FlxPoint(dad.getGraphicMidpoint().x, dad.getGraphicMidpoint().y);
|
var camPos:FlxPoint = new FlxPoint(dad.getGraphicMidpoint().x, dad.getGraphicMidpoint().y);
|
||||||
|
|
Loading…
Reference in a new issue