First_Person_Slapper/Levels/Level06.gd

33 lines
664 B
GDScript3
Raw Permalink Normal View History

2022-10-12 15:34:40 -04:00
extends Spatial
var enemycount = 1
onready var NEXTSCENE = "res://Levels/Level07.tscn"
onready var WinMess = $Messages/Win
onready var EndTimer = $End
onready var FirstTime = $Timer
2022-10-12 22:07:27 -04:00
onready var Eye = $RayCast
onready var player = $Player
2022-10-12 15:34:40 -04:00
2022-10-12 21:20:58 -04:00
onready var balls = $"Player/HUD/PlayerLayer/ActualHUD/Balls"
onready var rem = $"Player/HUD/PlayerLayer/ActualHUD/Remaining"
2022-10-12 15:34:40 -04:00
func _ready():
FirstTime.start()
2022-10-12 21:20:58 -04:00
balls.hide()
rem.hide()
2022-10-12 15:34:40 -04:00
2022-10-12 22:07:27 -04:00
func _process(delta):
Eye.look_at(player.transform.origin, Vector3.UP)
2022-10-12 15:34:40 -04:00
func _on_Enemy_dying():
enemycount -= 1
if enemycount == 0:
WinMess.show()
EndTimer.start()
func _on_Win_timeout():
get_tree().change_scene(NEXTSCENE)