32 lines
672 B
GDScript
32 lines
672 B
GDScript
extends Node
|
|
|
|
var playerdead = 0
|
|
var beforedeathscene
|
|
var tankskilled = 0
|
|
var firstlevelcompleted = 0
|
|
var playerhit = 0
|
|
var playerhealthbarscale = 2
|
|
var bulletdamage = 0
|
|
var playerhealthexecfinish = 0
|
|
var playerbody
|
|
var playerbulletdamage = 2
|
|
|
|
|
|
func _resetvars():
|
|
playerdead = 0
|
|
tankskilled = 0
|
|
playerhit = 0
|
|
playerhealthbarscale = 2
|
|
bulletdamage = 0
|
|
playerhealthexecfinish = 0
|
|
playerbulletdamage = 2
|
|
|
|
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
|