Skip to content

Commit

Permalink
desktop features
Browse files Browse the repository at this point in the history
  • Loading branch information
Streq committed Jul 22, 2023
1 parent b587b10 commit 1e37f49
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 20 deletions.
7 changes: 7 additions & 0 deletions AutoLoad/Global.gd
Original file line number Diff line number Diff line change
@@ -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()
6 changes: 6 additions & 0 deletions AutoLoad/Global.tscn
Original file line number Diff line number Diff line change
@@ -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 )
1 change: 1 addition & 0 deletions Levels/1/DeathCutscene.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
3 changes: 3 additions & 0 deletions Main.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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)
32 changes: 17 additions & 15 deletions Scenes/Title/Title.tscn
Original file line number Diff line number Diff line change
@@ -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]
Expand All @@ -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 )
Expand All @@ -28,47 +29,48 @@ 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 )
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 )
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"]
4 changes: 4 additions & 0 deletions Scenes/Title/quit.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
extends Label

func clicked():
get_tree().quit()
8 changes: 3 additions & 5 deletions project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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,
Expand All @@ -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={
Expand Down

0 comments on commit 1e37f49

Please sign in to comment.