mirror of
https://github.com/FunkinCrew/Funkin.git
synced 2025-04-21 19:31:52 -04:00
gf base shit
This commit is contained in:
parent
8a37bf319d
commit
0815f32a97
2 changed files with 42 additions and 1 deletions
35
source/Girlfriend.hx
Normal file
35
source/Girlfriend.hx
Normal file
|
@ -0,0 +1,35 @@
|
|||
package;
|
||||
|
||||
import flixel.graphics.frames.FlxAtlasFrames;
|
||||
|
||||
class Girlfriend extends Character
|
||||
{
|
||||
public function new(x:Float, y:Float)
|
||||
{
|
||||
super(x, y);
|
||||
|
||||
var tex = FlxAtlasFrames.fromSparrow(AssetPaths.GF_assets__png, AssetPaths.GF_assets__xml);
|
||||
frames = tex;
|
||||
animation.addByPrefix('cheer', 'GF Cheer');
|
||||
animation.addByIndices('danceLeft', 'GF Dancing Beat', [30, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14], "", 24, false);
|
||||
animation.addByIndices('danceRight', 'GF Dancing Beat', [15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29], "", 24, false);
|
||||
|
||||
addOffset('cheer');
|
||||
addOffset('danceLeft');
|
||||
addOffset('danceRight');
|
||||
|
||||
playAnim('danceRight');
|
||||
}
|
||||
|
||||
private var danced:Bool = false;
|
||||
|
||||
public function dance()
|
||||
{
|
||||
danced = !danced;
|
||||
|
||||
if (danced)
|
||||
playAnim('danceRight');
|
||||
else
|
||||
playAnim('danceLeft');
|
||||
}
|
||||
}
|
|
@ -32,6 +32,7 @@ class PlayState extends FlxState
|
|||
private var totalSteps:Int = 0;
|
||||
|
||||
private var dad:Dad;
|
||||
private var gf:Girlfriend;
|
||||
private var boyfriend:Boyfriend;
|
||||
|
||||
private var notes:FlxTypedGroup<Note>;
|
||||
|
@ -60,6 +61,10 @@ class PlayState extends FlxState
|
|||
bg.active = false;
|
||||
add(bg);
|
||||
|
||||
gf = new Girlfriend(400, 130);
|
||||
gf.scrollFactor.set(0.95, 0.95);
|
||||
add(gf);
|
||||
|
||||
dad = new Dad(100, 100);
|
||||
|
||||
add(dad);
|
||||
|
@ -632,7 +637,8 @@ class PlayState extends FlxState
|
|||
|
||||
totalBeats += 1;
|
||||
|
||||
dad.animation.play('idle');
|
||||
dad.playAnim('idle');
|
||||
gf.dance();
|
||||
|
||||
if (!boyfriend.animation.curAnim.name.startsWith("sing"))
|
||||
boyfriend.playAnim('idle');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue