(wip) Food now moves with a world flow (which is updated using a manual timer in the GameManager

This commit is contained in:
Martin committed 2026-02-07 16:24:37 +01:00
1 parent d5b33d66b8
commit bef1e9cb53
4 files changed
+49 -4

No files matched your search

@@ -5,11 +5,17 @@ extends Area2D
@export var val: int = 1
@export var food_name: String = "Food"
@export var flow_carry_speed: float = 10.0
signal consumed
func _ready() -> void:
pass
func _physics_process(delta: float) -> void:
var dpos = Vector2(GameManager.flow_x, GameManager.flow_y) * delta * flow_carry_speed
position += dpos
func _on_body_entered(body: Node2D) -> void:
pass
@@ -1,6 +1,7 @@
extends AbstractFood
class_name FoodMolecular
func _on_body_entered(body: Node2D) -> void:
eat(body)
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.