mirror of
https://github.com/duckduckdoof/miniopolis.git
synced 2025-03-22 11:42:19 +00:00
Updated error messages for deletion
This commit is contained in:
parent
5ae8539cdb
commit
850cbbe8ac
2 changed files with 6 additions and 2 deletions
|
@ -100,4 +100,7 @@ class GameLogic:
|
||||||
s_tiles = arcade.get_sprites_at_point((x,y), self.scene[LAYER_STRUCTURES])
|
s_tiles = arcade.get_sprites_at_point((x,y), self.scene[LAYER_STRUCTURES])
|
||||||
if len(s_tiles) == 1:
|
if len(s_tiles) == 1:
|
||||||
struct_sprites = self.scene[LAYER_STRUCTURES]
|
struct_sprites = self.scene[LAYER_STRUCTURES]
|
||||||
struct_sprites.remove(s_tiles[0])
|
struct_sprites.remove(s_tiles[0])
|
||||||
|
return ""
|
||||||
|
else:
|
||||||
|
return "No structure on that space."
|
|
@ -113,6 +113,7 @@ class GameBoard(arcade.Window):
|
||||||
self.build_mode = ""
|
self.build_mode = ""
|
||||||
|
|
||||||
def on_mouse_release(self, x, y, button, modifiers):
|
def on_mouse_release(self, x, y, button, modifiers):
|
||||||
|
res = ""
|
||||||
if self.pressed_key == arcade.key.X:
|
if self.pressed_key == arcade.key.X:
|
||||||
res = self.game_logic.delete_structure(x, y)
|
res = self.game_logic.delete_structure(x, y)
|
||||||
elif self.pressed_key == arcade.key.L:
|
elif self.pressed_key == arcade.key.L:
|
||||||
|
@ -175,7 +176,7 @@ class GameBoard(arcade.Window):
|
||||||
self.mode_text.draw()
|
self.mode_text.draw()
|
||||||
|
|
||||||
self.error_text.text = f"{self.error_msg}"
|
self.error_text.text = f"{self.error_msg}"
|
||||||
self.mode_text.draw()
|
self.error_text.draw()
|
||||||
|
|
||||||
# MAIN --------------------------------------------------------------
|
# MAIN --------------------------------------------------------------
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue