- Edited
I'm making a space shooter game and I'm trying to add score to it. I added a ready signal to the bullet sprite that's connected to a label. The code of the bullet and label is below. Please help!
Label code:
extends Label
var score = 0
func _on_Bullet_ready():
score += 100
String(text)
text == "Score: " %score
Bullet code:
extends KinematicBody
var velo = Vector3()
var KillParticles = load("res://haha space go shoot/KillBOOOOOm.tscn")
onready var main = get_tree().current_scene
onready var explodeSound = $EnemyExplode
onready var score = $ScoreLabel
onready var text = $ScoreLabel.text
func _physics_process(delta):
move_and_slide(velo)
func _on_Area_body_entered(body):
if body.is_in_group("Enemies"):
var particles = KillParticles.instance()
main.add_child(particles)
particles.transform.origin = transform.origin
body.queue_free()
explodeSound.play()
visible = false
$Area/CollisionShape.disabled = true
emit_signal("ready")
func _on_LightTimer_timeout():
$OmniLight.visible = false