tank-blaster/misc/scripts/global.gd

32 lines
646 B
GDScript3
Raw Normal View History

2022-03-03 21:56:35 -07:00
extends Node
2022-03-17 15:13:55 -06:00
var playerdead = 0
var beforedeathscene
2022-03-25 00:21:02 -06:00
var tankskilled = 0
var firstlevelcompleted = 0
2022-04-22 13:34:43 -06:00
var playerhit = 0
var playerhealthbarscale = 2
var bulletdamage = 0
var playerhealthexecfinish = 0
var playerbody
2022-04-22 13:34:43 -06:00
func _resetvars():
playerdead = 0
tankskilled = 0
firstlevelcompleted = 0
playerhit = 0
playerhealthbarscale = 2
bulletdamage = 0
playerhealthexecfinish = 0
func _player_dead():
if playerhealthbarscale <= 0:
playerbody.queue_free()
playerdead = 1
tankskilled = 0
beforedeathscene = get_tree().current_scene.filename
get_tree().change_scene("res://Levels/Dead.tscn")
playerhealthbarscale = 2
playerhit = 0