summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Andrade de Almeida <vct.a.almeida@gmail.com>2022-07-17 14:53:44 -0300
committerVictor Andrade de Almeida <vct.a.almeida@gmail.com>2022-07-17 14:53:44 -0300
commitf1ec2f4195050d1b7620f8723522ea680828e01e (patch)
treeb9301cc1e388b2b2fa95fcedd7b7e7ce24e31139
parent608b6275b9949363c12c1a6348624246d8a7f9e2 (diff)
downloadgamejam-gmtk-2022-f1ec2f4195050d1b7620f8723522ea680828e01e.tar.gz
gamejam-gmtk-2022-f1ec2f4195050d1b7620f8723522ea680828e01e.tar.bz2
gamejam-gmtk-2022-f1ec2f4195050d1b7620f8723522ea680828e01e.zip
Fix first turn collision
-rw-r--r--Scenes/Dungeon.gd3
1 files changed, 2 insertions, 1 deletions
diff --git a/Scenes/Dungeon.gd b/Scenes/Dungeon.gd
index 35a1714..7247136 100644
--- a/Scenes/Dungeon.gd
+++ b/Scenes/Dungeon.gd
@@ -118,6 +118,7 @@ func process_turn_logic():
# player attack
var cur_tile = entities_tiles[player]
var new_tile = cur_tile + input
+ new_tile = new_tile.round()
# simulate roll to attack
player.roll(input)
@@ -194,7 +195,7 @@ func _input(event):
func move_entity(entity : Entity, dir : Vector2):
var cur_tile = entities_tiles[entity]
var new_tile = cur_tile + dir
- new_tile = Vector2(round(new_tile.x), round(new_tile.y))
+ new_tile = new_tile.round()
if tiles_entities.has(new_tile):
if entity.has_method("cor_shake"):