Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | CB |
I need a help.
I can not show the score in my game
I dont get to use signal it’s more confuse to me.
extends Node # main node of my game
var score = 0
func _ready():
$player.connect(“coin_taken”, self, “_on_coin_was_taken”)
func _process(delta):
pass
func on_coin_was_taken():
score = score + 1
$HUD/display/coin_anim/coins.text = score
print (score)
extends Area2D #this is the coin item
signal coin_taken
func _on_moeda_body_entered(body):
if "player" in body.name:
emit_signal("coin_taken")
queue_free()
nothing happens!
I don’t know where I’m mistaking