Skip to content

Commit

Permalink
Elegance. Perfection. Less Janky Code.
Browse files Browse the repository at this point in the history
  • Loading branch information
craftersshaft committed Jul 31, 2021
1 parent c97af8d commit 5795003
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions source/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -3737,25 +3737,22 @@ class PlayState extends MusicBeatState
var holdArray:Array<Bool> = [controls.LEFT, controls.DOWN, controls.UP, controls.RIGHT];
var pressArray:Array<Bool> = [controls.LEFT_P, controls.DOWN_P, controls.UP_P, controls.RIGHT_P];
var releaseArray:Array<Bool> = [controls.LEFT_R, controls.DOWN_R, controls.UP_R, controls.RIGHT_R];
var keynameArray:Array<String> = ['left', 'down', 'up', 'right'];
#if windows
if (luaModchart != null)
{
if (controls.LEFT_P)
{
luaModchart.executeState('keyPressed', ["left"]);
};
if (controls.DOWN_P)
{
luaModchart.executeState('keyPressed', ["down"]);
};
if (controls.UP_P)
{
luaModchart.executeState('keyPressed', ["up"]);
for (i in 0...pressArray.length) {
if (pressArray[i] == true) {
luaModchart.executeState('keyPressed', [keynameArray[i]]);
}
};
if (controls.RIGHT_P)
{
luaModchart.executeState('keyPressed', ["right"]);

for (i in 0...releaseArray.length) {
if (releaseArray[i] == true) {
luaModchart.executeState('keyReleased', [keynameArray[i]]);
}
};

};
#end

Expand Down

0 comments on commit 5795003

Please sign in to comment.