Return to repo list

heart-of-gold

Tactical RPG written in python, using pygame.
Return to HMagellan.com

commit d80a65b2f105a7de0bd783c43dd310a51f04768a
parent 4fff45f0ec7697a532acc86344a6142678c87801
Author: Erik Letson <hmagellan@hmagellan.com>
Date:   Wed, 23 Sep 2020 14:48:15 -0500

Improved flow of move aux controls

Diffstat:
Msrc/board.py | 2+-
Msrc/game.py | 8+++++++-
2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/board.py b/src/board.py @@ -111,7 +111,7 @@ class BoardManager(manager.Manager): if isinstance(layer, pytmx.TiledTileLayer): for x, y, gid in layer: for p in tile_pos_list: - if p == (x, y) and self.current_board.tmx_data.get_tile_properties_by_gid(gid)["Passable"] == 1: + if p == (x, y) and self.current_board.tmx_data.get_tile_properties_by_gid(gid)["Passable"] == 1 and self.game.entity_manager.selected_entity.tile_pos != (x, y): v = vgo.VisibleGameObject(self.game.sheet_manager.loaded_sheets["board_overlays_1"]) v.set_position((x * self.current_board.tmx_data.tilewidth, y * self.current_board.tmx_data.tileheight)) v.set_sprite((1, 0)) diff --git a/src/game.py b/src/game.py @@ -157,7 +157,11 @@ class GameInterface(GameSubsystem): """ React to a key being pressed. """ - pass + if self.control_mode == "Turn_Select_Move": + if event.key == pygame.K_q: + self.control_mode = "Turn_Normal" + # TODO: Should this really be done here??? + self.game.board_manager.load_overlay() def handle_key_release(self, event): """ @@ -169,6 +173,8 @@ class GameInterface(GameSubsystem): """ React to a mousebutton being clicked. """ + # TODO: Decision order should go "mode" -> "button" rather than + # "button" -> "mode" as currently here. if event.button == 1: if self.control_mode == "Turn_Normal": if self.game.entity_manager.select_entities_with_tile_cursor(self.game.board_manager.get_tile_at_position(pygame.mouse.get_pos())):