![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | D_Dazzle |
So I’m making a endless space shooter game, and I’m trying to set up scoring but nothing is working. I’ve tried using labels and areas. The way my code is set up is for the enemies they die when my bullet hits them, but I don’t have hp set up. Is it just that I am a noob and don’t know how to use labels?
My bullet code:
extends KinematicBody
var velo = Vector3()
var KillParticles = load(“res://KillParticles.tscn”)
onready var main = get_tree().current_scene
onready var explodeSound = $EnemyExplode
var score = 0
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()
score += 10
explodeSound.play()
visible = false
$Area/CollisionShape.disabled = true
func _on_LightTimer_timeout():
$OmniLight.visible = false
Well for one its odd to have the score inside the bullet scene since it will most likely be freed at some point
Wakatta | 2021-11-21 00:53