Allow clicks too; remove silly special-casing of space bar

This commit is contained in:
Tony Garnock-Jones 2018-12-13 10:39:45 +00:00
parent 8e8a1d9989
commit ce5b1f5a48
1 changed files with 4 additions and 6 deletions

View File

@ -44,9 +44,8 @@ spawn named 'game-factory' {
on start spawnGame();
during GameOver() {
on stop spawnGame();
on message UI.WindowEvent('+keypress', $e) {
if (e.key !== ' ') send Reset();
}
on message UI.WindowEvent('+keypress', $e) send Reset();
on message UI.WindowEvent('+click', $e) send Reset();
}
}
@ -97,9 +96,8 @@ function spawnGame() {
on start react {
stop on asserted GameOver();
on message Inbound(UI.WindowEvent('+keypress', $e)) {
this.yvel = -10;
}
on message Inbound(UI.WindowEvent('+keypress', $e)) this.yvel = -10;
on message Inbound(UI.WindowEvent('+click', $e)) this.yvel = -10;
const ms_per_tick = 1000.0 / 60;
on message Inbound(PeriodicTick(Double(ms_per_tick))) {