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

This commit is contained in:
MartinOpat 2026-02-01 13:09:41 +01:00
commit b21bf52938
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 sprite = get_node("AnimatedSprite2D")
@onready var fsm = $StateMachine @onready var fsm = $StateMachine
@export var speed = 0.5
var desired_rotation: float = self.rotation var desired_rotation: float = self.rotation
# Mirrored sprites for periodic boundary # Mirrored sprites for periodic boundary
@ -43,7 +44,7 @@ func _physics_process(delta: float) -> void:
pass pass
func move(motion: Vector3) -> void: 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) self.desired_rotation = atan2(motion.y, motion.x)
# Apply boundary to new position # Apply boundary to new position

View File

@ -53,6 +53,7 @@ animations = [{
collision_layer = 2 collision_layer = 2
motion_mode = 1 motion_mode = 1
script = ExtResource("2_0227s") script = ExtResource("2_0227s")
speed = 0.5
maxHealth = 20 maxHealth = 20
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="." index="0" unique_id=788182944] [node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="." index="0" unique_id=788182944]