Merge remote-tracking branch 'refs/remotes/origin/stage/molecular' into stage/molecular
This commit is contained in:
commit
b21bf52938
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@ animations = [{
|
|||
collision_layer = 2
|
||||
motion_mode = 1
|
||||
script = ExtResource("2_0227s")
|
||||
speed = 0.5
|
||||
maxHealth = 20
|
||||
|
||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="." index="0" unique_id=788182944]
|
||||
|
|
|
|||
Loading…
Reference in New Issue