Merge remote-tracking branch 'refs/remotes/origin/stage/molecular' into stage/molecular

This commit is contained in:
2026-02-01 13:09:41 +01:00
2 changed files with 3 additions and 1 deletions

View File

@@ -3,6 +3,7 @@ extends AbstractPrey2D
@onready var sprite = get_node("AnimatedSprite2D")
@onready var fsm = $StateMachine
@export var speed = 0.5
var desired_rotation: float = self.rotation
# Mirrored sprites for periodic boundary
@@ -43,7 +44,7 @@ func _physics_process(delta: float) -> void:
pass
func move(motion: Vector3) -> void:
move_and_collide(Vector2(motion.x, motion.y)) # Moves along the given vector
move_and_collide(Vector2(motion.x, motion.y).normalized() * self.speed) # Moves along the given vector
self.desired_rotation = atan2(motion.y, motion.x)
# Apply boundary to new position