This commit is contained in:
Tabby 2025-09-03 21:34:33 +10:00
parent 6ce339b430
commit 314f485f01
15 changed files with 318 additions and 17 deletions

View file

@ -4,6 +4,7 @@ extends Node2D
@export var count : Label
@export var my_area : Area2D
@export var brain : Node2D
@export var pit_sprite : AnimatedSprite2D
var player_detected : bool
# Called when the node enters the scene tree for the first time.
@ -20,10 +21,13 @@ func _process(delta: float) -> void:
if overlaps.is_in_group("braincell"):
player_detected = true
if player_detected:
modulate = Color.GREEN
modulate = Color (2,2,2)
else:
modulate = Color.WHITE
if(snake_man.pit_apples <= 19):
pit_sprite.frame = snake_man.pit_apples
else:
pit_sprite.frame = 19
#print(str(player_detected) + " "+ str(snake_man.pit_apples) +" " +str(brain.holding_apple))
if player_detected and snake_man.pit_apples > 0 and not brain.holding_apple: