Missiles limit & UI

This commit is contained in:
Felipe M 2021-05-18 20:43:07 +02:00
parent 853eb28d33
commit 632d927938
Signed by: fmartingr
GPG key ID: 716BC147715E716F
5 changed files with 55 additions and 2 deletions

View file

@ -82,7 +82,7 @@ func _physics_process(delta):
if Input.is_action_pressed("fire") and fireBulletTimer.time_left == 0:
fire_bullet()
if Input.is_action_pressed("fire_missile") and fireBulletTimer.time_left == 0:
if Input.is_action_pressed("fire_missile") and fireBulletTimer.time_left == 0 and PlayerStats.missiles > 0:
fire_missile()
func fire_bullet():
@ -99,6 +99,7 @@ func fire_missile():
motion -= missile.velocity * 0.25
missile.rotation = missile.velocity.angle()
fireBulletTimer.start()
PlayerStats.missiles -= 1
func create_dust_effect():
var dust_position = global_position