1
0
mirror of https://github.com/JohnBreaux/Boat-Battle.git synced 2024-11-15 05:25:57 +00:00

Fixed bug

Bug fixed:
- moving the ship piece in place crashes game and triggers debugging
This commit is contained in:
tommy-l-ngo 2021-10-31 23:05:22 -05:00
parent 71cc294774
commit 16719e3adc

View File

@ -1,6 +1,5 @@
extends RigidBody2D extends RigidBody2D
# Declare member variables here. Examples: # Declare member variables here. Examples:
# var a = 2 # var a = 2
# var b = "text" # var b = "text"
@ -26,6 +25,7 @@ func _input(event):
if (position.x > 17.4 and position.x < 337.5) and (position.y > 20.2 and position.y < 335.5): if (position.x > 17.4 and position.x < 337.5) and (position.y > 20.2 and position.y < 335.5):
position = position.snapped(Vector2(32, 32)) + Vector2(4, 4) position = position.snapped(Vector2(32, 32)) + Vector2(4, 4)
else: else:
if originalPos != null:
position = originalPos position = originalPos
if event is InputEventMouseMotion and held: if event is InputEventMouseMotion and held: