diff --git a/AutoLoad/Global.gd b/AutoLoad/Global.gd new file mode 100644 index 0000000..0352840 --- /dev/null +++ b/AutoLoad/Global.gd @@ -0,0 +1,7 @@ +extends Node +export var deaths := 0 + +func _input(event: InputEvent) -> void: + if OS.has_feature("pc"): + if event.is_action_pressed("ui_cancel"): + get_tree().quit() diff --git a/AutoLoad/Global.tscn b/AutoLoad/Global.tscn new file mode 100644 index 0000000..fe46c21 --- /dev/null +++ b/AutoLoad/Global.tscn @@ -0,0 +1,6 @@ +[gd_scene load_steps=2 format=2] + +[ext_resource path="res://AutoLoad/Global.gd" type="Script" id=1] + +[node name="Global" type="Node"] +script = ExtResource( 1 ) diff --git a/Levels/1/DeathCutscene.gd b/Levels/1/DeathCutscene.gd index b2a14ab..31c9863 100644 --- a/Levels/1/DeathCutscene.gd +++ b/Levels/1/DeathCutscene.gd @@ -23,6 +23,7 @@ func _on_body_exited(body): func trigger_cutscene(): triggered = true + Global.deaths += 1 BranchPause.pause_scene(player, true) $sound.play() yield(get_tree().create_timer(1),"timeout") diff --git a/Main.gd b/Main.gd index 56de5c7..fc4c99e 100644 --- a/Main.gd +++ b/Main.gd @@ -4,4 +4,7 @@ extends CanvasLayer export(PackedScene) var first_scene func _ready(): + if OS.has_feature("pc"): + OS.window_fullscreen = true + SignalSingleton.emit_signal("goto_world",first_scene) diff --git a/Scenes/Title/Title.tscn b/Scenes/Title/Title.tscn index c487cbe..1edc4b8 100644 --- a/Scenes/Title/Title.tscn +++ b/Scenes/Title/Title.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=8 format=2] +[gd_scene load_steps=9 format=2] [ext_resource path="res://assets/z.png" type="Texture" id=1] [ext_resource path="res://Levels/0/Level0.tscn" type="PackedScene" id=2] @@ -7,6 +7,7 @@ [ext_resource path="res://assets/title_background.png" type="Texture" id=5] [ext_resource path="res://Scenes/Title/play.gd" type="Script" id=6] [ext_resource path="res://Scenes/Title/text_button.gd" type="Script" id=7] +[ext_resource path="res://Scenes/Title/quit.gd" type="Script" id=8] [node name="Title" type="Control"] script = ExtResource( 3 ) @@ -28,12 +29,9 @@ margin_left = 20.0 margin_top = 64.0 margin_right = 64.0 margin_bottom = 114.0 -__meta__ = { -"_edit_use_anchors_": false -} [node name="play" type="Label" parent="VBoxContainer"] -margin_right = 44.0 +margin_right = 123.0 margin_bottom = 14.0 text = "jugar" script = ExtResource( 6 ) @@ -41,7 +39,7 @@ scene = ExtResource( 2 ) [node name="credits" type="Label" parent="VBoxContainer"] margin_top = 18.0 -margin_right = 44.0 +margin_right = 123.0 margin_bottom = 32.0 text = "credits" script = ExtResource( 7 ) @@ -49,26 +47,30 @@ display_text = "lo hice yo" [node name="controls" type="Label" parent="VBoxContainer"] margin_top = 36.0 -margin_right = 44.0 +margin_right = 123.0 margin_bottom = 50.0 -text = "ctrls" +text = "haber los controles" script = ExtResource( 7 ) display_text = "con z saltas, las flechitas te moves, la direccion del salto depende de las flechitas" +[node name="quit" type="Label" parent="VBoxContainer"] +margin_top = 54.0 +margin_right = 123.0 +margin_bottom = 68.0 +text = "salir" +script = ExtResource( 8 ) + [node name="index" type="Sprite" parent="."] position = Vector2( 0, 64 ) texture = ExtResource( 1 ) centered = false [node name="texto" type="Label" parent="."] -margin_left = 12.3067 -margin_top = 121.739 -margin_right = 111.307 -margin_bottom = 221.739 +margin_left = 12.0 +margin_top = 133.0 +margin_right = 125.0 +margin_bottom = 222.0 autowrap = true -__meta__ = { -"_edit_use_anchors_": false -} [connection signal="change_text" from="VBoxContainer/credits" to="." method="_on_change_text"] [connection signal="change_text" from="VBoxContainer/controls" to="." method="_on_change_text"] diff --git a/Scenes/Title/quit.gd b/Scenes/Title/quit.gd new file mode 100644 index 0000000..94fa2bc --- /dev/null +++ b/Scenes/Title/quit.gd @@ -0,0 +1,4 @@ +extends Label + +func clicked(): + get_tree().quit() diff --git a/project.godot b/project.godot index 62f5e09..464e58a 100644 --- a/project.godot +++ b/project.godot @@ -41,6 +41,7 @@ config/icon="res://icon.png" [autoload] +Global="*res://AutoLoad/Global.tscn" BranchPause="*res://AutoLoad/branch_pause.gd" SignalSingleton="*res://AutoLoad/signal_singleton.gd" MusicPlayer="*res://AutoLoad/MusicPlayer/MusicPlayer.tscn" @@ -66,7 +67,8 @@ ui_select={ } ui_cancel={ "deadzone": 0.5, -"events": [ ] +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777217,"physical_scancode":0,"unicode":0,"echo":false,"script":null) + ] } ui_focus_next={ "deadzone": 0.5, @@ -79,25 +81,21 @@ ui_focus_prev={ ui_left={ "deadzone": 0.5, "events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777231,"physical_scancode":0,"unicode":0,"echo":false,"script":null) -, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":14,"pressure":0.0,"pressed":false,"script":null) ] } ui_right={ "deadzone": 0.5, "events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777233,"physical_scancode":0,"unicode":0,"echo":false,"script":null) -, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":15,"pressure":0.0,"pressed":false,"script":null) ] } ui_up={ "deadzone": 0.5, "events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777232,"physical_scancode":0,"unicode":0,"echo":false,"script":null) -, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":12,"pressure":0.0,"pressed":false,"script":null) ] } ui_down={ "deadzone": 0.5, "events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777234,"physical_scancode":0,"unicode":0,"echo":false,"script":null) -, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":13,"pressure":0.0,"pressed":false,"script":null) ] } ui_page_up={