ugly win screen completed

This commit is contained in:
Leon Palluch committed 2020-02-01 15:09:11 +01:00
1 parent 7d4d0254d9
commit 677138d145
4 files changed
+98 -15

No files matched your search

+49
View File
@@ -0,0 +1,49 @@
extends Node
var _win_screen_scene
var _fighting_scene_path = "res://Ingame/Testing.tscn"
#test vars
var test = 0
var tested = false
signal player_win(player_id)
func _ready():
_win_screen_scene = preload("res://UI/WinScreen.tscn").instance()
#_fighting_scene = preload("res://Ingame/Testing.tscn").instance()
connect("player_win", self, "_switch_to_win")
_win_screen_scene.connect("start_fight", self, "_switch_to_fighting")
func _switch_scene(scene):
#delete children
for child in get_children():
child.queue_free()
#append win scene
add_child(scene)
func _switch_to_win(player_id):
_switch_scene(_win_screen_scene)
#call win message in win scene
_win_screen_scene.set_win_message(player_id)
func _switch_to_fighting():
#_switch_scene(_fighting_scene)
get_tree().reload_current_scene()
# test
#func _process(delta):
#if test > 3 and not tested:
#tested = true
#test = 0
#emit_signal("player_win", 1)
#else:
#test += delta
+9
View File
@@ -0,0 +1,9 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://Controllers/GameStateController.gd" type="Script" id=1]
[ext_resource path="res://Ingame/Testing.tscn" type="PackedScene" id=2]
[node name="GameStateController" type="Node"]
script = ExtResource( 1 )
[node name="InGame" parent="." instance=ExtResource( 2 )]