Skip to content
This repository was archived by the owner on Oct 18, 2025. It is now read-only.

Commit 0d54a50

Browse files
omg epic fixes
1 parent 8d5a2cd commit 0d54a50

File tree

7 files changed

+77
-95
lines changed

7 files changed

+77
-95
lines changed

assets/stages/tank.hx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ var spawnTimes:Array<Array<Float>> = [];
148148

149149
function createRunningTankmans()
150150
{
151-
for (note in this.strumLines.extras.members[0].chartNotes)
151+
for (note in this.strumLines.extras[0].chartNotes)
152152
if (FlxG.random.bool(16) && note[0] > 1000)
153153
spawnTimes.push([note[0], note[1] % 2 == 0]);
154154
}

source/funkin/states/PlayState.hx

Lines changed: 41 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,8 @@ class PlayState extends ScriptState
215215
{
216216
super.update(elapsed);
217217

218+
strumLines.update();
219+
218220
callOnScripts('onUpdate', [elapsed]);
219221

220222
var firsEvent = events[0];
@@ -498,20 +500,20 @@ class PlayState extends ScriptState
498500
switch (type)
499501
{
500502
case OPPONENT:
501-
STAGE.opponentsPosition[characters.opponents.members.length][0];
503+
STAGE.opponentsPosition[characters.opponents.length][0];
502504
case PLAYER:
503-
STAGE.playersPosition[characters.players.members.length][0];
505+
STAGE.playersPosition[characters.players.length][0];
504506
case EXTRA:
505-
STAGE.extrasPosition[characters.extras.members.length][0];
507+
STAGE.extrasPosition[characters.extras.length][0];
506508
},
507509
switch (type)
508510
{
509511
case OPPONENT:
510-
STAGE.opponentsPosition[characters.opponents.members.length][1];
512+
STAGE.opponentsPosition[characters.opponents.length][1];
511513
case PLAYER:
512-
STAGE.playersPosition[characters.players.members.length][1];
514+
STAGE.playersPosition[characters.players.length][1];
513515
case EXTRA:
514-
STAGE.extrasPosition[characters.extras.members.length][1];
516+
STAGE.extrasPosition[characters.extras.length][1];
515517
},
516518
character[0], cast character[1]
517519
);
@@ -523,23 +525,23 @@ class PlayState extends ScriptState
523525
switch (type)
524526
{
525527
case PLAYER:
526-
if (characters.players.members.length <= 0)
528+
if (characters.players.length <= 0)
527529
{
528530
playerIconName = object.data.icon;
529531
playerColor = FlxColor.fromRGB(objectColor[0], objectColor[1], objectColor[2]);
530532
}
531533

532-
characters.players.add(object);
534+
characters.players.push(object);
533535
case OPPONENT:
534-
if (characters.opponents.members.length <= 0)
536+
if (characters.opponents.length <= 0)
535537
{
536538
opponentIconName = object.data.icon;
537539
opponentColor = FlxColor.fromRGB(objectColor[0], objectColor[1], objectColor[2]);
538540
}
539541

540-
characters.opponents.add(object);
542+
characters.opponents.push(object);
541543
case EXTRA:
542-
characters.extras.add(object);
544+
characters.extras.push(object);
543545
}
544546

545547
add(object);
@@ -634,11 +636,11 @@ class PlayState extends ScriptState
634636
switch (character.type)
635637
{
636638
case PLAYER:
637-
strumLines.players.add(strl);
639+
strumLines.players.push(strl);
638640
case OPPONENT:
639-
strumLines.opponents.add(strl);
641+
strumLines.opponents.push(strl);
640642
case EXTRA:
641-
strumLines.extras.add(strl);
643+
strumLines.extras.push(strl);
642644
}
643645

644646
add(strl);
@@ -1086,29 +1088,32 @@ class PlayState extends ScriptState
10861088
{
10871089
var char:Character = charactersArray[SONG.sections[section].focus];
10881090

1089-
switch (char.type)
1091+
if (char != null)
10901092
{
1091-
case OPPONENT:
1092-
camPosition.x = char.getMidpoint().x + 150;
1093-
camPosition.x += char.cameraPosition[0];
1094-
camPosition.x += STAGE.opponentsCamera[characters.opponents.members.indexOf(char)][0];
1095-
camPosition.y = char.getMidpoint().y - 100;
1096-
camPosition.y += char.cameraPosition[1];
1097-
camPosition.y += STAGE.opponentsCamera[characters.opponents.members.indexOf(char)][1];
1098-
case PLAYER:
1099-
camPosition.x = char.getMidpoint().x - 100;
1100-
camPosition.x -= char.cameraPosition[0];
1101-
camPosition.x += STAGE.playersCamera[characters.players.members.indexOf(char)][0];
1102-
camPosition.y = char.getMidpoint().y - 100;
1103-
camPosition.y += char.cameraPosition[1];
1104-
camPosition.y += STAGE.playersCamera[characters.players.members.indexOf(char)][1];
1105-
case EXTRA:
1106-
camPosition.x = char.getMidpoint().x;
1107-
camPosition.x += char.cameraPosition[0];
1108-
camPosition.x += STAGE.extrasCamera[characters.extras.members.indexOf(char)][0];
1109-
camPosition.y = char.getMidpoint().y;
1110-
camPosition.y += char.cameraPosition[1];
1111-
camPosition.y += STAGE.extrasCamera[characters.extras.members.indexOf(char)][1];
1093+
switch (char.type)
1094+
{
1095+
case OPPONENT:
1096+
camPosition.x = char.getMidpoint().x + 150;
1097+
camPosition.x += char.cameraPosition[0];
1098+
camPosition.x += STAGE.opponentsCamera[characters.opponents.indexOf(char)][0];
1099+
camPosition.y = char.getMidpoint().y - 100;
1100+
camPosition.y += char.cameraPosition[1];
1101+
camPosition.y += STAGE.opponentsCamera[characters.opponents.indexOf(char)][1];
1102+
case PLAYER:
1103+
camPosition.x = char.getMidpoint().x - 100;
1104+
camPosition.x -= char.cameraPosition[0];
1105+
camPosition.x += STAGE.playersCamera[characters.players.indexOf(char)][0];
1106+
camPosition.y = char.getMidpoint().y - 100;
1107+
camPosition.y += char.cameraPosition[1];
1108+
camPosition.y += STAGE.playersCamera[characters.players.indexOf(char)][1];
1109+
case EXTRA:
1110+
camPosition.x = char.getMidpoint().x;
1111+
camPosition.x += char.cameraPosition[0];
1112+
camPosition.x += STAGE.extrasCamera[characters.extras.indexOf(char)][0];
1113+
camPosition.y = char.getMidpoint().y;
1114+
camPosition.y += char.cameraPosition[1];
1115+
camPosition.y += STAGE.extrasCamera[characters.extras.indexOf(char)][1];
1116+
}
11121117
}
11131118
}
11141119

source/funkin/visuals/editors/chart/ChartNote.hx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class ChartNote extends FlxSprite
4444

4545
if (sustain != null)
4646
{
47-
sustain.scale.y = msToPixels(length, CELL_SIZE * Conductor.stepsPerBeat * Conductor.beatsPerSection);
47+
sustain.scale.y = length / Conductor.sectionCrochet * CELL_SIZE * Conductor.stepsPerBeat * Conductor.beatsPerSection;
4848
sustain.updateHitbox();
4949

5050
updateSustain();
@@ -53,9 +53,6 @@ class ChartNote extends FlxSprite
5353
return length;
5454
}
5555

56-
function msToPixels(ms:Float, theHeight:Float):Float
57-
return ms / Conductor.sectionCrochet * theHeight;
58-
5956
public var data(default, set):Int;
6057
function set_data(value:Int):Int
6158
{
@@ -115,10 +112,13 @@ class ChartNote extends FlxSprite
115112
shaderRef = new RGBShaderReference(this, rgbPalette);
116113

117114
sustain = new FlxSprite().makeGraphic(Math.floor(CELL_SIZE / 6), 1);
115+
updateSustain();
118116

119117
this.length = length;
120118

121119
this.selected = false;
120+
121+
antialiasing = ClientPrefs.data.antialiasing;
122122
}
123123

124124
override function update(elapsed:Float)
@@ -139,6 +139,9 @@ class ChartNote extends FlxSprite
139139

140140
public function updateSustain()
141141
{
142+
if (sustain == null)
143+
return;
144+
142145
sustain.x = x + width / 2 - sustain.width / 2;
143146
sustain.y = y + height / 2;
144147
sustain.alpha = alpha * 0.5;
Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,13 @@
11
package funkin.visuals.game;
22

3-
class CharactersGroup extends FlxTypedGroup<FlxTypedGroup<Character>>
3+
class CharactersGroup
44
{
5-
public var extras:FlxTypedGroup<Character>;
6-
public var opponents:FlxTypedGroup<Character>;
7-
public var players:FlxTypedGroup<Character>;
5+
public var extras:Array<Character> = [];
6+
public var opponents:Array<Character> = [];
7+
public var players:Array<Character> = [];
88

9-
override public function new()
10-
{
11-
super();
9+
public function new() {}
1210

13-
extras = new FlxTypedGroup<Character>();
14-
add(extras);
15-
16-
opponents = new FlxTypedGroup<Character>();
17-
add(opponents);
18-
19-
players = new FlxTypedGroup<Character>();
20-
add(players);
21-
}
22-
23-
public function getGroups():Array<FlxTypedGroup<Character>>
11+
public function getGroups():Array<Array<Character>>
2412
return [extras, opponents, players];
2513
}

source/funkin/visuals/game/StrumLinesGroup.hx

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,18 @@
11
package funkin.visuals.game;
22

3-
class StrumLinesGroup extends FlxTypedGroup<FlxTypedGroup<StrumLine>>
3+
class StrumLinesGroup
44
{
5-
public var extras:FlxTypedGroup<StrumLine>;
6-
public var opponents:FlxTypedGroup<StrumLine>;
7-
public var players:FlxTypedGroup<StrumLine>;
5+
public var extras:Array<StrumLine> = [];
6+
public var opponents:Array<StrumLine> = [];
7+
public var players:Array<StrumLine> = [];
88

9-
override public function new()
10-
{
11-
super();
12-
13-
extras = new FlxTypedGroup<StrumLine>();
14-
add(extras);
15-
16-
opponents = new FlxTypedGroup<StrumLine>();
17-
add(opponents);
18-
19-
players = new FlxTypedGroup<StrumLine>();
20-
add(players);
21-
}
9+
public function new() {};
2210

2311
public function getGroups()
2412
return [extras, players, opponents];
2513

26-
override function update(elapsed:Float)
14+
public function update()
2715
{
28-
super.update(elapsed);
29-
3016
if (Controls.NOTE_LEFT_P)
3117
forEachStrumLine((strum:StrumLine) -> { strum.justPressKey(0); });
3218

source/scripting/haxe/HaxePlayState.hx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ class HaxePlayState
1313
return switch(type)
1414
{
1515
case PLAYER:
16-
PlayState.instance.characters.players.members[index];
16+
PlayState.instance.characters.players[index];
1717
case OPPONENT:
18-
PlayState.instance.characters.opponents.members[index];
18+
PlayState.instance.characters.opponents[index];
1919
case EXTRA:
20-
PlayState.instance.characters.extras.members[index];
20+
PlayState.instance.characters.extras[index];
2121
}
2222
}
2323
);
@@ -27,11 +27,11 @@ class HaxePlayState
2727
return switch(type)
2828
{
2929
case PLAYER:
30-
PlayState.instance.strumLines.players.members[groupIndex].strums.members[strumIndex];
30+
PlayState.instance.strumLines.players[groupIndex].strums.members[strumIndex];
3131
case OPPONENT:
32-
PlayState.instance.strumLines.opponents.members[groupIndex].strums.members[strumIndex];
32+
PlayState.instance.strumLines.opponents[groupIndex].strums.members[strumIndex];
3333
case EXTRA:
34-
PlayState.instance.strumLines.extras.members[groupIndex].strums.members[strumIndex];
34+
PlayState.instance.strumLines.extras[groupIndex].strums.members[strumIndex];
3535
}
3636
}
3737
);

source/scripting/lua/LuaPlayState.hx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class LuaPlayState extends LuaPresetBase
5858
if (tagIs(tag, FlxObject))
5959
{
6060
if (type == STATE)
61-
ScriptState.instance.insert(ScriptState.instance.members.indexOf(), getTag(tag));
61+
ScriptState.instance.insert(ScriptState.instance.indexOf(), getTag(tag));
6262
}
6363
}
6464
);
@@ -70,11 +70,11 @@ class LuaPlayState extends LuaPresetBase
7070
return switch(type)
7171
{
7272
case PLAYER:
73-
game.characters.players.members[index];
73+
game.characters.players[index];
7474
case OPPONENT:
75-
game.characters.opponents.members[index];
75+
game.characters.opponents[index];
7676
case EXTRA:
77-
game.characters.extras.members[index];
77+
game.characters.extras[index];
7878
}
7979
}
8080

@@ -83,11 +83,11 @@ class LuaPlayState extends LuaPresetBase
8383
return switch(type)
8484
{
8585
case PLAYER:
86-
game.strumLines.players.members[index];
86+
game.strumLines.players[index];
8787
case OPPONENT:
88-
game.strumLines.opponents.members[index];
88+
game.strumLines.opponents[index];
8989
case EXTRA:
90-
game.strumLines.extras.members[index];
90+
game.strumLines.extras[index];
9191
}
9292
}
9393

@@ -96,11 +96,11 @@ class LuaPlayState extends LuaPresetBase
9696
return switch(type)
9797
{
9898
case PLAYER:
99-
game.strumLines.players.members[groupIndex].strums.members[index];
99+
game.strumLines.players[groupIndex].strums.members[index];
100100
case OPPONENT:
101-
game.strumLines.opponents.members[groupIndex].strums.members[index];
101+
game.strumLines.opponents[groupIndex].strums.members[index];
102102
case EXTRA:
103-
game.strumLines.extras.members[groupIndex].strums.members[index];
103+
game.strumLines.extras[groupIndex].strums.members[index];
104104
}
105105
}
106106
}

0 commit comments

Comments
 (0)