need to sleep
This commit is contained in:
parent
dafae35985
commit
211a5e074b
13 changed files with 381 additions and 15 deletions
31
apple_furnace_man.gd
Normal file
31
apple_furnace_man.gd
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
extends Node2D
|
||||
|
||||
@export var snake_man : Node2D
|
||||
@export var count : Label
|
||||
@export var my_area : Area2D
|
||||
@export var brain : Node2D
|
||||
var player_detected : bool
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
pass # Replace with function body.
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta: float) -> void:
|
||||
count.text = str( ceilf(snake_man.burn_apples*10)/10 )
|
||||
if my_area.get_overlapping_areas():
|
||||
player_detected = false
|
||||
for overlaps in my_area.get_overlapping_areas():
|
||||
if overlaps.is_in_group("braincell"):
|
||||
player_detected = true
|
||||
if player_detected:
|
||||
modulate = Color.GREEN
|
||||
else:
|
||||
modulate = Color.WHITE
|
||||
|
||||
|
||||
#print(str(player_detected) + " "+ str(snake_man.pit_apples) +" " +str(brain.holding_apple))
|
||||
if player_detected and brain.holding_apple:
|
||||
if Input.is_action_just_pressed("action"):
|
||||
Router.burn_apple.emit()
|
||||
Loading…
Add table
Add a link
Reference in a new issue