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
|
2022-04-22 20:04:23 -06:00
|
|
|
var playerbody
|
2022-04-23 20:59:56 -06:00
|
|
|
var playerbulletdamage = 2
|
2022-04-22 13:34:43 -06:00
|
|
|
|
|
|
|
|
|
|
|
func _resetvars():
|
|
|
|
playerdead = 0
|
|
|
|
tankskilled = 0
|
|
|
|
playerhit = 0
|
|
|
|
playerhealthbarscale = 2
|
|
|
|
bulletdamage = 0
|
|
|
|
playerhealthexecfinish = 0
|
2022-04-23 20:59:56 -06:00
|
|
|
playerbulletdamage = 2
|
2022-04-22 20:04:23 -06:00
|
|
|
|
|
|
|
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
|