Missiles limit & UI
This commit is contained in:
parent
853eb28d33
commit
632d927938
5 changed files with 55 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue