diff --git a/breakout.js b/breakout.js index 91d722d..3b9531c 100644 --- a/breakout.js +++ b/breakout.js @@ -164,10 +164,34 @@ killbox.register_hit(hit => { //Sound.play("start.wav"); -let gamepawn = -{ +var pause = { + gui() { + var pausecolor = [0,0,0,100]; + Debug.box(Window.dimensions.scale(0.5), Window.dimensions, pausecolor); + GUI.text_fn("PAUSE", {font_size: 3, anchor: [0.5,0.5]}).draw(Window.dimensions.scale([0.5,0.5])); + }, + + unpause() { + unregister_gui(pause.gui); + }, + input_escape_pressed() { - backtomain(); + pause.unpause(); + Player.players[0].control(gamepawn); + }, +}; + + +var gamepawn = +{ + pause() { + register_gui(pause.gui); + }, + + input_escape_pressed() { + this.pause(); + Player.players[0].uncontrol(gamepawn); + Player.players[0].control(pause); }, input_o_pressed() { diff --git a/bugs.md b/bugs.md index 0d31854..e723a62 100644 --- a/bugs.md +++ b/bugs.md @@ -1,5 +1,9 @@ * Changing img of sprite sometimes changes different sprite * Bounding box calculates incorrect width * Calculate bounding box without instantiating first + - For both gameobjects and GUI items +* Implement pausing - stop updates on needed objects +* Add GUI layering +* Add generic signal sending from C code based on strings - Look up collision functions dynamically instead of with registry