automerge
This commit is contained in:
commit
5509a5d488
Binary file not shown.
Binary file not shown.
BIN
3D Input/Mensch_Bein.blend
Normal file
BIN
3D Input/Mensch_Bein.blend
Normal file
Binary file not shown.
BIN
3D Input/Mensch_Bein.blend1
Normal file
BIN
3D Input/Mensch_Bein.blend1
Normal file
Binary file not shown.
49
Controllers/GameStateController.gd
Normal file
49
Controllers/GameStateController.gd
Normal 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
Controllers/GameStateController.tscn
Normal file
9
Controllers/GameStateController.tscn
Normal 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 )]
|
@ -10,28 +10,52 @@ __meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
labelPath = NodePath("MarginContainer/VBoxContainer/PlayerWon")
|
||||
continuePath = NodePath("MarginContainer/VBoxContainer/Control/Continue")
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="."]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer"]
|
||||
margin_right = 1024.0
|
||||
margin_bottom = 600.0
|
||||
|
||||
[node name="Congratz" type="Label" parent="MarginContainer/VBoxContainer"]
|
||||
margin_top = -1.0
|
||||
margin_right = 1024.0
|
||||
margin_bottom = 249.0
|
||||
margin_bottom = 250.0
|
||||
rect_min_size = Vector2( 0, 250 )
|
||||
text = "CONGRATULATIONS!"
|
||||
align = 1
|
||||
valign = 2
|
||||
|
||||
[node name="PlayerWon" type="Label" parent="MarginContainer/VBoxContainer"]
|
||||
margin_top = 254.0
|
||||
margin_top = 253.0
|
||||
margin_right = 1024.0
|
||||
margin_bottom = 404.0
|
||||
rect_min_size = Vector2( 0, 150 )
|
||||
margin_bottom = 503.0
|
||||
rect_min_size = Vector2( 0, 250 )
|
||||
align = 1
|
||||
valign = 1
|
||||
|
||||
[node name="Control" type="Control" parent="MarginContainer/VBoxContainer"]
|
||||
margin_top = 508.0
|
||||
margin_right = 1024.0
|
||||
margin_bottom = 508.0
|
||||
|
||||
[node name="Continue" type="Button" parent="MarginContainer/VBoxContainer/Control"]
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
margin_left = -100.0
|
||||
margin_top = -10.0
|
||||
margin_right = 100.0
|
||||
margin_bottom = 15.0
|
||||
rect_min_size = Vector2( 200, 25 )
|
||||
text = "Continue"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
[connection signal="pressed" from="MarginContainer/VBoxContainer/Control/Continue" to="." method="_on_Continue_pressed"]
|
||||
|
@ -1,22 +1,23 @@
|
||||
extends Control
|
||||
|
||||
export(NodePath) var labelPath
|
||||
export(NodePath) var continuePath
|
||||
|
||||
#signal player_win(player_id)
|
||||
signal start_fight()
|
||||
|
||||
var _playerWonLabel
|
||||
var _continueButton
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
_playerWonLabel = get_node(labelPath) as Label
|
||||
|
||||
#connect("player_win", self, "_win_message")
|
||||
|
||||
#emit_signal("player_win", 1)
|
||||
_continueButton = get_node(continuePath) as Label
|
||||
|
||||
|
||||
func _win_message(player_id):
|
||||
_playerWonLabel.text = "test"
|
||||
func set_win_message(player_id):
|
||||
_playerWonLabel.text = "Player " + str(player_id + 1) + " is victorious!"
|
||||
|
||||
#print("game won!")
|
||||
#print(player_id)
|
||||
|
||||
func _on_Continue_pressed():
|
||||
print("test2")
|
||||
|
||||
emit_signal("start_fight")
|
||||
|
Loading…
x
Reference in New Issue
Block a user