Godot Version
godot 4
extends Node
@onready var points_label: Label = %pointsLabel
var points = 0
func add_point():
points += 1
print(points)
points_label.text = "points: " + str(points);
extends Area2D
@onready var game_manegar: Node = %“game manegar”
func _on_body_entered(body: Node2D) → void:
if (body.name == “CharacterBody2D”):
queue_free()
game_manegar.add_point()
This code was working but after I added the enemies it stopped working