0 votes
extends Node



signal score_updated
signal player_died


var score: = 0 setget set_score
var deaths: = 0 setget set_deaths

func set_score(value: int) -> void:
    score = value
    emit_signal("score_updated")

func player_deaths(value: int) -> void:
    deaths = value
    emit_signal("player_died")
in Engine by (16 points)
edited by

Note: edited for code formatting. In future please use the "Code Sample" button to format your code properly.

1 Answer

+1 vote
Best answer

var deaths: = 0 setget set_deaths

You haven't defined set_deaths(). You made a function called player_deaths().

by (20,917 points)
selected by
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.