Skip to content

Commit f4dfb16

Browse files
committed
Added More Null Checks To Character So Things Shouldent Explode If An Animation Doesnt Exist, Made It So You Can Override The Dance Function, Fixed Stress/Added Pico Speaker, Removed "Playable" Characters
1 parent bf5792c commit f4dfb16

18 files changed

Lines changed: 4038 additions & 821 deletions

File tree

assets/data/characters/pico-playable.json

Lines changed: 0 additions & 135 deletions
This file was deleted.

assets/data/characters/pico-player.json

Lines changed: 0 additions & 122 deletions
This file was deleted.
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
// TODO: make it so this can work on any song cuz rn this only works on VSlicey Charts
2+
// holy shit this code is messy:sob:
3+
4+
var epicChart:Dynamic;
5+
var randomGuys:Array = [];
6+
7+
function postCreate() {
8+
epicChart = Paths.json('data/songs/' + PlayState.instance.SONG.song.toLowerCase() + '/chart').notes.picospeaker;
9+
playAnim("shoot0-loop", true);
10+
11+
for (i => note in epicChart) {
12+
if (FlxG.random.bool(16) && FlxG.save.data.distractions) {
13+
var tankmanGuy = new FlxAnimate(500, 200 + FlxG.random.int(50, 100));
14+
tankmanGuy.frames = Paths.getAnimateAtlas("stages/tankmanBattlefield/tankman_stress");
15+
tankmanGuy.anim.addBySymbol("walk", "tankman running", 24, true);
16+
tankmanGuy.anim.addBySymbol("shot", "John Shot " + FlxG.random.int(1, 2), 24, false);
17+
tankmanGuy.anim.play("walk", true);
18+
tankmanGuy.flipX = note.d < 2;
19+
tankmanGuy.visible = false;
20+
FlxG.state.insert(11, tankmanGuy);
21+
22+
randomGuys.push([note.t, {
23+
"guy": tankmanGuy,
24+
"endOffset": FlxG.random.float(50, 200),
25+
"speed": FlxG.random.float(0.6, 1)
26+
}]);
27+
}
28+
}
29+
}
30+
31+
function update(elapsed) {
32+
for (meow in randomGuys) {
33+
if (meow[1].guy.anim.curAnim.name == "walk") {
34+
if (meow[1].guy.x >= FlxG.width * 1.2 || meow[1].guy.x <= FlxG.width * -0.5)
35+
meow[1].guy.visible = false;
36+
else
37+
meow[1].guy.visible = true;
38+
39+
var endDirection:Float = (FlxG.width * 0.74) + meow[1].endOffset;
40+
41+
if (meow[1].guy.flipX)
42+
{
43+
endDirection = (FlxG.width * 0.02) - meow[1].endOffset;
44+
45+
meow[1].guy.x = (endDirection + (Conductor.songPosition - meow[0]) * meow[1].speed);
46+
}
47+
else
48+
{
49+
meow[1].guy.x = (endDirection - (Conductor.songPosition - meow[0]) * meow[1].speed);
50+
}
51+
} else {
52+
if (meow[1].guy.anim.curAnim.finished)
53+
meow[1].guy.kill();
54+
}
55+
}
56+
57+
for (note in epicChart) {
58+
if (Conductor.songPosition > note.t) {
59+
epicChart.remove(note);
60+
61+
for (meow in randomGuys) {
62+
if (meow[0] == note.t) {
63+
meow[1].guy.anim.play("shot", true);
64+
if (meow[1].guy.flipX)
65+
{
66+
meow[1].guy.offset.y = 200;
67+
meow[1].guy.offset.x = 300;
68+
}
69+
70+
randomGuys.remove(moew);
71+
}
72+
}
73+
74+
playAnim("shoot" + note.d, true);
75+
animation.finishCallback = (n) -> {
76+
playAnim(animation.curAnim.name + "-loop", true);
77+
animation.finishCallback = (n) -> {};
78+
};
79+
}
80+
}
81+
}

0 commit comments

Comments
 (0)