when the keys are Just Pressed

This commit is contained in:
craftersshaft 2021-05-25 16:20:10 -04:00
parent 1af694d72d
commit c11bb668ba
2 changed files with 8 additions and 0 deletions

View File

@ -116,6 +116,7 @@ Current calls to functions include,
| update | Elapsed frames | Gets called every frame (after the song starts) |
| stepHit | Current Step | Gets called when ever a step hits (steps are in between beats, aka 4 steps are in a beat) |
| beatHit | Current Beat | Gets called when ever a beat hits |
| keyPressed | Key Pressed | Gets called when a key just got pressed (up, down, left, right, accept) |

View File

@ -2832,6 +2832,13 @@ class PlayState extends MusicBeatState
controls.UP_R,
controls.RIGHT_R
];
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"]);};
if (controls.RIGHT_P){luaModchart.executeState('keyPressed',["right"]);};
if (controls.ACCEPT_P){luaModchart.executeState('keyPressed',["accept"]);};
};
// Prevent player input if botplay is on
if(FlxG.save.data.botplay)