From 88a8f255d3d0a5773c4b66d37052fcfd5dc8fb85 Mon Sep 17 00:00:00 2001 From: Jan Schuffenhauer Date: Sat, 18 Apr 2020 12:55:45 +0200 Subject: [PATCH 1/3] Added TitleSccreen Scene and added Font --- src/Fonts/Harmonic/Harmonic.ttf | Bin 0 -> 10024 bytes src/Fonts/Harmonic/Harmonic24.tres | 7 ++++++ src/Menus/TitleScreen/TitleScreen.tscn | 31 +++++++++++++++++++++++++ 3 files changed, 38 insertions(+) create mode 100644 src/Fonts/Harmonic/Harmonic.ttf create mode 100644 src/Fonts/Harmonic/Harmonic24.tres create mode 100644 src/Menus/TitleScreen/TitleScreen.tscn diff --git a/src/Fonts/Harmonic/Harmonic.ttf b/src/Fonts/Harmonic/Harmonic.ttf new file mode 100644 index 0000000000000000000000000000000000000000..2dd85837e7b32a2d6f194e83e87f41122d61f2e4 GIT binary patch literal 10024 zcmcgyYiu3G6+Sz=dmp}j;FwEzWE0yri6Mr>_QeUrxv&WkAP~aS1PBl(B*Y?)t-O>X zwc56-6rn1uTBJTy6@&_+sH&3us7i&?Mncx+x%=c5mH!@Ak)^Jo`(cp-w=T-F)LsTd9YZ6RrLL z_se(Ovu^Bb|JZVz$U1=g$-OgEbI*K#?s+2n7Qmj|d;DlW4XTqw&ad#?d3@@~T)j@9 zu=-ux7al+Oh5b+c!utx5`%R!bcVOStV?C=suHhNuUw;4q_YvzI;980Ml?P^yo_MCy zeh&8`ekTvk?wvYu$=oAA{TiPCdS>dx9Q~M%;2G#s|Dmawec#!dZ}9HX_aE)q^fxM@E6N}2*Pk_YJ*<=RZN4p#;tB<0Y^oFOQb9c= zQodlqgShMw$R654uE2PtB`}}X3dFLWw?5&g>U-)OAm7ln^;fD|ML;PhM5S-i!tL16 zqx;FHembprum!EYfXHzgBBs0OQbC#&bR2 zkNYQMlCc;Q(Syo>p8>|;C-VrC@ewXRjSqb=w|Z#CE5AMM z^xWfqLDFAvg^Z7kTv;Am?C7_Qm4I>-5N<6ahjyY~LKgs{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21Zs$7p#7I=z-0w{Ub3HD8&x#pH1US*GKyhodrZd~N{tRuZPSclf)nwc zeN=3{Pj+^!YtAo$lV1l&ekpbt8Vu>WeKbh6WGv(~9X=Z3qkJ<19Mf^c!2xOOh~w*o zb3vq1GRK~T*Bpo(IV|4haE71V#i!Pv)SS|K!@0lg$KnVOouwe1EQ@z8_B=G^PyB0u zGf0>m4yd$i>O)ZEP~*HiTWC;kwlyPLllEzSww`Zl>ZX~oUBrPZ#{pg zO;Z7Pgnh#p@C}iF^7}WoisT)t^g%a8xafir-Skr(4bU#&9}u#O#kGKJK)3P77rHTO z+gQtIqqc)S-;UZY{yFh#)Xo9^HsPNY4&Jo^&Tj>{ZJ~Wx)K=6<>!Y?!gLGTecF^a` zQQM_{`a#sr0scGM4%&z430&vs7#$(nK6~hi*|}qA-9l4zm}aEIH0=do>hR3$p=q?X z(>{8PrZHj$H~Su&KE`zes*TMU4DyW$s(GkPg34j=G%bkxX#}59{IiJb5zK@p_Z>bm zJ$tBsWMp*h$jAsF^I(G#xxh}~+bzl-z+eiHj)R>BOT0)O(0M0yL8Cp8RxfnfM;Bt> zauMDLT#O9tQb>Op-UBYj`CvcJS_Ww)va8j|>MzI2y9V!Tu7u9l!XugUF;Ko5S;>0Z zK-bW@oy8lj(nVxZJ`@r6F1RTx*5~Bm9{~Hw?n9R&o7?cH!SMkI Date: Sat, 18 Apr 2020 14:21:22 +0200 Subject: [PATCH 2/3] Added basic title screen functionality --- .../Tilesets/Room/tileset_room.png.import | 8 ++-- src/Menus/Startup/Startup.gd | 9 ++++ src/Menus/Startup/Startup.tscn | 1 + src/Menus/TitleScreen/TitleScreen.gd | 11 +++++ src/Menus/TitleScreen/TitleScreen.tscn | 46 +++++++++++++------ src/Menus/TitleScreen/TitleScreenButton.gd | 12 +++++ src/Menus/TitleScreen/TitleScreenButton.tscn | 21 +++++++++ src/World.tscn | 5 +- src/project.godot | 14 +++++- 9 files changed, 104 insertions(+), 23 deletions(-) create mode 100644 src/Menus/TitleScreen/TitleScreen.gd create mode 100644 src/Menus/TitleScreen/TitleScreenButton.gd create mode 100644 src/Menus/TitleScreen/TitleScreenButton.tscn diff --git a/src/Maps/Tilesets/Room/tileset_room.png.import b/src/Maps/Tilesets/Room/tileset_room.png.import index 46ecfd2..b2bfd20 100644 --- a/src/Maps/Tilesets/Room/tileset_room.png.import +++ b/src/Maps/Tilesets/Room/tileset_room.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/tileset_room.png-.stex" +path="res://.import/tileset_room.png-674987c7ba950a0a830d1caa96e0c19a.stex" metadata={ "vram_texture": false } [deps] -source_file="tileset_room.png" -dest_files=[ "res://.import/tileset_room.png-.stex" ] +source_file="res://Maps/Tilesets/Room/tileset_room.png" +dest_files=[ "res://.import/tileset_room.png-674987c7ba950a0a830d1caa96e0c19a.stex" ] [params] @@ -31,4 +31,4 @@ process/invert_color=false stream=false size_limit=0 detect_3d=true -svg/scale=1.0 \ No newline at end of file +svg/scale=1.0 diff --git a/src/Menus/Startup/Startup.gd b/src/Menus/Startup/Startup.gd index abb5733..ca44f0e 100644 --- a/src/Menus/Startup/Startup.gd +++ b/src/Menus/Startup/Startup.gd @@ -1,5 +1,7 @@ extends AnimatedSprite +signal startup_finished +var finished_once := false # Declare member variables here. Examples: # var a = 2 @@ -14,3 +16,10 @@ func _ready(): # Called every frame. 'delta' is the elapsed time since the previous frame. #func _process(delta): # pass + + +func _on_Startup_animation_finished(): + if not finished_once: + emit_signal("startup_finished") + finished_once = true + frame = 80 diff --git a/src/Menus/Startup/Startup.tscn b/src/Menus/Startup/Startup.tscn index 75463c3..389c22b 100644 --- a/src/Menus/Startup/Startup.tscn +++ b/src/Menus/Startup/Startup.tscn @@ -134,3 +134,4 @@ animations = [ { frames = SubResource( 1 ) centered = false script = ExtResource( 121 ) +[connection signal="animation_finished" from="." to="." method="_on_Startup_animation_finished"] diff --git a/src/Menus/TitleScreen/TitleScreen.gd b/src/Menus/TitleScreen/TitleScreen.gd new file mode 100644 index 0000000..cf405d1 --- /dev/null +++ b/src/Menus/TitleScreen/TitleScreen.gd @@ -0,0 +1,11 @@ +extends Control +class_name TitleScreen + +onready var new_game_button = $"VBoxContainer/NewGameButton" + +func _ready(): + new_game_button.grab_focus() + + +func _on_Startup_startup_finished(): + pass # Replace with function body. diff --git a/src/Menus/TitleScreen/TitleScreen.tscn b/src/Menus/TitleScreen/TitleScreen.tscn index 5e38d91..2ad1f60 100644 --- a/src/Menus/TitleScreen/TitleScreen.tscn +++ b/src/Menus/TitleScreen/TitleScreen.tscn @@ -1,6 +1,8 @@ -[gd_scene load_steps=2 format=2] +[gd_scene load_steps=4 format=2] -[ext_resource path="res://Fonts/Harmonic/Harmonic24.tres" type="DynamicFont" id=1] +[ext_resource path="res://Menus/TitleScreen/TitleScreenButton.tscn" type="PackedScene" id=1] +[ext_resource path="res://Menus/Startup/Startup.tscn" type="PackedScene" id=2] +[ext_resource path="res://Menus/TitleScreen/TitleScreen.gd" type="Script" id=3] [node name="TitleScreen" type="Control"] anchor_left = -0.00168862 @@ -9,23 +11,39 @@ anchor_right = 0.998311 anchor_bottom = 0.996998 margin_left = 0.875977 margin_right = 0.875977 +script = ExtResource( 3 ) __meta__ = { "_edit_use_anchors_": false } +[node name="Startup" parent="." instance=ExtResource( 2 )] + [node name="VBoxContainer" type="VBoxContainer" parent="."] -margin_right = 40.0 -margin_bottom = 40.0 +anchor_left = 0.623951 +anchor_top = 0.225224 +anchor_right = 0.970827 +anchor_bottom = 0.469669 +margin_left = 1.52588e-05 __meta__ = { -"_edit_use_anchors_": false +"_edit_group_": true, +"_edit_use_anchors_": true } -[node name="Label" type="Label" parent="VBoxContainer"] -margin_right = 111.0 -margin_bottom = 24.0 -custom_fonts/font = ExtResource( 1 ) -text = "Start Game" -__meta__ = { -"_edit_use_anchors_": false, -"_editor_description_": "" -} +[node name="NewGameButton" parent="VBoxContainer" instance=ExtResource( 1 )] +scene_to_load = "res://World.tscn" + +[node name="Label" parent="VBoxContainer/NewGameButton" index="0"] +text = "New Game" + +[node name="QuitButton" parent="VBoxContainer" instance=ExtResource( 1 )] +margin_top = 24.0 +margin_bottom = 44.0 +quit = true + +[node name="Label" parent="VBoxContainer/QuitButton" index="0"] +text = "Quit" +[connection signal="startup_finished" from="Startup" to="." method="_on_Startup_startup_finished"] + +[editable path="VBoxContainer/NewGameButton"] + +[editable path="VBoxContainer/QuitButton"] diff --git a/src/Menus/TitleScreen/TitleScreenButton.gd b/src/Menus/TitleScreen/TitleScreenButton.gd new file mode 100644 index 0000000..b27dd80 --- /dev/null +++ b/src/Menus/TitleScreen/TitleScreenButton.gd @@ -0,0 +1,12 @@ +extends Button +class_name TitleSceenButton + +export(String, FILE, "*.tscn,*.scn") var scene_to_load = "" +export(bool) var quit = false + +func _pressed(): + if quit: + get_tree().quit() + return + + get_tree().change_scene(scene_to_load) diff --git a/src/Menus/TitleScreen/TitleScreenButton.tscn b/src/Menus/TitleScreen/TitleScreenButton.tscn new file mode 100644 index 0000000..b41d6c6 --- /dev/null +++ b/src/Menus/TitleScreen/TitleScreenButton.tscn @@ -0,0 +1,21 @@ +[gd_scene load_steps=3 format=2] + +[ext_resource path="res://Fonts/Harmonic/Harmonic24.tres" type="DynamicFont" id=1] +[ext_resource path="res://Menus/TitleScreen/TitleScreenButton.gd" type="Script" id=2] + +[node name="TitleScreenButton" type="Button"] +margin_right = 110.0 +margin_bottom = 20.0 +flat = true +script = ExtResource( 2 ) +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Label" type="Label" parent="."] +custom_fonts/font = ExtResource( 1 ) +text = "Label" +__meta__ = { +"_edit_use_anchors_": false, +"_editor_description_": "" +} diff --git a/src/World.tscn b/src/World.tscn index f8a243b..1aed996 100644 --- a/src/World.tscn +++ b/src/World.tscn @@ -1,7 +1,6 @@ -[gd_scene load_steps=3 format=2] +[gd_scene load_steps=2 format=2] [ext_resource path="res://Player/Player.tscn" type="PackedScene" id=1] -[ext_resource path="res://Menus/Startup/Startup.tscn" type="PackedScene" id=2] [node name="World" type="Node2D"] @@ -12,5 +11,3 @@ position = Vector2( 164.844, 101.687 ) [node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="StaticBody2D"] polygon = PoolVector2Array( 192.287, 146.593, 265.375, 115.213, 228.831, 67.1505, 257.43, 37.3594, 218.9, 7.9655, 298.343, 3.59614, 310.26, 179.959, 11.9516, 168.837, 42.9343, 30.6067, 69.1505, 118.788, 86.628, 87.4084, 96.5583, 127.527 ) - -[node name="Startup" parent="." instance=ExtResource( 2 )] diff --git a/src/project.godot b/src/project.godot index b826f9e..7a449b1 100644 --- a/src/project.godot +++ b/src/project.godot @@ -13,9 +13,21 @@ _global_script_classes=[ { "class": "Player", "language": "GDScript", "path": "res://Player/Player.gd" +}, { +"base": "Button", +"class": "TitleSceenButton", +"language": "GDScript", +"path": "res://Menus/TitleScreen/TitleScreenButton.gd" +}, { +"base": "Control", +"class": "TitleScreen", +"language": "GDScript", +"path": "res://Menus/TitleScreen/TitleScreen.gd" } ] _global_script_class_icons={ -"Player": "" +"Player": "", +"TitleSceenButton": "", +"TitleScreen": "" } [application] From 766a18d9f4732a3fbb4d5854ef83c0955b68bcb2 Mon Sep 17 00:00:00 2001 From: Paul Norberger Date: Sat, 18 Apr 2020 15:41:11 +0200 Subject: [PATCH 3/3] Title screen and credits Also skipping with space. Nice. --- src/Fonts/Harmonic/Harmonic12.tres | 7 + src/Menus/Credits/Credits.gd | 14 ++ src/Menus/Credits/Credits.tscn | 83 ++++++++++++ src/Menus/Startup/Startup.gd | 16 ++- src/Menus/TitleScreen/TitleScreen.gd | 7 +- src/Menus/TitleScreen/TitleScreen.tscn | 175 ++++++++++++++++++++++++- src/project.godot | 8 +- 7 files changed, 299 insertions(+), 11 deletions(-) create mode 100644 src/Fonts/Harmonic/Harmonic12.tres create mode 100644 src/Menus/Credits/Credits.gd create mode 100644 src/Menus/Credits/Credits.tscn diff --git a/src/Fonts/Harmonic/Harmonic12.tres b/src/Fonts/Harmonic/Harmonic12.tres new file mode 100644 index 0000000..f02057a --- /dev/null +++ b/src/Fonts/Harmonic/Harmonic12.tres @@ -0,0 +1,7 @@ +[gd_resource type="DynamicFont" load_steps=2 format=2] + +[ext_resource path="res://Fonts/Harmonic/Harmonic.ttf" type="DynamicFontData" id=1] + +[resource] +size = 12 +font_data = ExtResource( 1 ) diff --git a/src/Menus/Credits/Credits.gd b/src/Menus/Credits/Credits.gd new file mode 100644 index 0000000..b89b6b7 --- /dev/null +++ b/src/Menus/Credits/Credits.gd @@ -0,0 +1,14 @@ +extends Node2D + +export(String, FILE, "*.tscn,*.scn") var scene_to_load = "" +onready var animation_player = $AnimationPlayer + +func _process(delta): + if Input.is_action_pressed("skip"): + animation_player.playback_speed = 8.0 + else: + animation_player.playback_speed = 1.0 + + +func _on_AnimationPlayer_animation_finished(anim_name): + get_tree().change_scene(scene_to_load) diff --git a/src/Menus/Credits/Credits.tscn b/src/Menus/Credits/Credits.tscn new file mode 100644 index 0000000..08bcdbc --- /dev/null +++ b/src/Menus/Credits/Credits.tscn @@ -0,0 +1,83 @@ +[gd_scene load_steps=4 format=2] + +[ext_resource path="res://Fonts/Harmonic/Harmonic12.tres" type="DynamicFont" id=1] +[ext_resource path="res://Menus/Credits/Credits.gd" type="Script" id=2] + +[sub_resource type="Animation" id=1] +resource_name = "scroll" +length = 25.0 +tracks/0/type = "value" +tracks/0/path = NodePath("Label:margin_top") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0, 24.9 ), +"transitions": PoolRealArray( 1, 1 ), +"update": 0, +"values": [ 200.0, -600 ] +} + +[node name="Credits" type="Node2D"] +script = ExtResource( 2 ) +scene_to_load = "res://Menus/TitleScreen/TitleScreen.tscn" + +[node name="ColorRect" type="ColorRect" parent="."] +margin_right = 320.0 +margin_bottom = 180.0 +color = Color( 0, 0, 0, 1 ) +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Label" type="Label" parent="."] +margin_left = 10.0 +margin_top = -436.145 +margin_right = 40.0 +margin_bottom = 14.0 +custom_fonts/font = ExtResource( 1 ) +text = "---- Team ---- +DerAnonymos +https://www.youtube.com/c/DerAnonymosLP +https://twitch.tv/deranonymos +https://www.instagram.com/deranonymos/ + +Katsuhira +https://www.youtube.com/c/Katsuhira +https://twitter.com/nKatsuhira + +Sonaion + +Mienek + +Streamfire +https://twitter.com/_streamfire_ + +YellowKamel +https://www.youtube.com/channel/UCgF6E6Hk4cNQBGDmcAEp5CA + +creyD + +---- Help ---- +Dave Loyd, Crawl +https://twitter.com/DuzzOnDrums +https://www.powerhoof.com/ + +HeartBeast +https://www.youtube.com/user/uheartbeast +https://www.heartgamedev.com + +---- Fonts ---- +Harmonic by Monkopus +https://monkopus.itch.io/ +https://twitter.com/monkopus +https://www.instagram.com/monkopusgames/" +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="AnimationPlayer" type="AnimationPlayer" parent="."] +autoplay = "scroll" +anims/scroll = SubResource( 1 ) +[connection signal="animation_finished" from="AnimationPlayer" to="." method="_on_AnimationPlayer_animation_finished"] diff --git a/src/Menus/Startup/Startup.gd b/src/Menus/Startup/Startup.gd index ca44f0e..bd692f9 100644 --- a/src/Menus/Startup/Startup.gd +++ b/src/Menus/Startup/Startup.gd @@ -3,6 +3,9 @@ extends AnimatedSprite signal startup_finished var finished_once := false +export(int) var startup_finish_frame = 65 +export(int) var loop_frame = 80 + # Declare member variables here. Examples: # var a = 2 # var b = "text" @@ -12,6 +15,14 @@ var finished_once := false func _ready(): play("default") +func _process(delta): + if Input.is_action_just_pressed("skip"): + frame = startup_finish_frame + + if frame > startup_finish_frame: + if not finished_once: + emit_signal("startup_finished") + finished_once = true # Called every frame. 'delta' is the elapsed time since the previous frame. #func _process(delta): @@ -19,7 +30,4 @@ func _ready(): func _on_Startup_animation_finished(): - if not finished_once: - emit_signal("startup_finished") - finished_once = true - frame = 80 + frame = loop_frame diff --git a/src/Menus/TitleScreen/TitleScreen.gd b/src/Menus/TitleScreen/TitleScreen.gd index cf405d1..af2172f 100644 --- a/src/Menus/TitleScreen/TitleScreen.gd +++ b/src/Menus/TitleScreen/TitleScreen.gd @@ -2,10 +2,11 @@ extends Control class_name TitleScreen onready var new_game_button = $"VBoxContainer/NewGameButton" +onready var animation_player = $AnimationPlayer func _ready(): - new_game_button.grab_focus() - + animation_player.play("__INIT__") func _on_Startup_startup_finished(): - pass # Replace with function body. + new_game_button.grab_focus() + animation_player.play("show_buttons") diff --git a/src/Menus/TitleScreen/TitleScreen.tscn b/src/Menus/TitleScreen/TitleScreen.tscn index 2ad1f60..51286fc 100644 --- a/src/Menus/TitleScreen/TitleScreen.tscn +++ b/src/Menus/TitleScreen/TitleScreen.tscn @@ -1,9 +1,161 @@ -[gd_scene load_steps=4 format=2] +[gd_scene load_steps=6 format=2] [ext_resource path="res://Menus/TitleScreen/TitleScreenButton.tscn" type="PackedScene" id=1] [ext_resource path="res://Menus/Startup/Startup.tscn" type="PackedScene" id=2] [ext_resource path="res://Menus/TitleScreen/TitleScreen.gd" type="Script" id=3] +[sub_resource type="Animation" id=2] +resource_name = "__INIT__" +length = 0.1 +tracks/0/type = "value" +tracks/0/path = NodePath("VBoxContainer/NewGameButton:anchor_left") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ 1.25 ] +} +tracks/1/type = "value" +tracks/1/path = NodePath("VBoxContainer/NewGameButton:anchor_right") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ 1.25 ] +} +tracks/2/type = "value" +tracks/2/path = NodePath("VBoxContainer/CreditsButton:anchor_left") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ 1.25 ] +} +tracks/3/type = "value" +tracks/3/path = NodePath("VBoxContainer/CreditsButton:anchor_right") +tracks/3/interp = 1 +tracks/3/loop_wrap = true +tracks/3/imported = false +tracks/3/enabled = true +tracks/3/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ 1.25 ] +} +tracks/4/type = "value" +tracks/4/path = NodePath("VBoxContainer/QuitButton:anchor_left") +tracks/4/interp = 1 +tracks/4/loop_wrap = true +tracks/4/imported = false +tracks/4/enabled = true +tracks/4/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ 1.25 ] +} +tracks/5/type = "value" +tracks/5/path = NodePath("VBoxContainer/QuitButton:anchor_right") +tracks/5/interp = 1 +tracks/5/loop_wrap = true +tracks/5/imported = false +tracks/5/enabled = true +tracks/5/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ 1.25 ] +} + +[sub_resource type="Animation" id=1] +resource_name = "show_buttons" +step = 0.3 +tracks/0/type = "value" +tracks/0/path = NodePath("VBoxContainer/NewGameButton:anchor_left") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0, 0.9 ), +"transitions": PoolRealArray( 1, -2 ), +"update": 0, +"values": [ 1.25, 0.0 ] +} +tracks/1/type = "value" +tracks/1/path = NodePath("VBoxContainer/NewGameButton:anchor_right") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/keys = { +"times": PoolRealArray( 0, 0.9 ), +"transitions": PoolRealArray( 1, -2 ), +"update": 0, +"values": [ 1.25, 0.0 ] +} +tracks/2/type = "value" +tracks/2/path = NodePath("VBoxContainer/CreditsButton:anchor_left") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/keys = { +"times": PoolRealArray( 0, 0.6 ), +"transitions": PoolRealArray( 1, -2 ), +"update": 0, +"values": [ 1.25, 0.0 ] +} +tracks/3/type = "value" +tracks/3/path = NodePath("VBoxContainer/CreditsButton:anchor_right") +tracks/3/interp = 1 +tracks/3/loop_wrap = true +tracks/3/imported = false +tracks/3/enabled = true +tracks/3/keys = { +"times": PoolRealArray( 0, 0.6 ), +"transitions": PoolRealArray( 1, -2 ), +"update": 0, +"values": [ 1.25, 0.0 ] +} +tracks/4/type = "value" +tracks/4/path = NodePath("VBoxContainer/QuitButton:anchor_left") +tracks/4/interp = 1 +tracks/4/loop_wrap = true +tracks/4/imported = false +tracks/4/enabled = true +tracks/4/keys = { +"times": PoolRealArray( 0, 0.3 ), +"transitions": PoolRealArray( 1, -2 ), +"update": 0, +"values": [ 1.25, 0.0 ] +} +tracks/5/type = "value" +tracks/5/path = NodePath("VBoxContainer/QuitButton:anchor_right") +tracks/5/interp = 1 +tracks/5/loop_wrap = true +tracks/5/imported = false +tracks/5/enabled = true +tracks/5/keys = { +"times": PoolRealArray( 0, 0.3 ), +"transitions": PoolRealArray( 1, -2 ), +"update": 0, +"values": [ 1.25, 0.0 ] +} + [node name="TitleScreen" type="Control"] anchor_left = -0.00168862 anchor_top = -0.003002 @@ -20,7 +172,7 @@ __meta__ = { [node name="VBoxContainer" type="VBoxContainer" parent="."] anchor_left = 0.623951 -anchor_top = 0.225224 +anchor_top = 0.056 anchor_right = 0.970827 anchor_bottom = 0.469669 margin_left = 1.52588e-05 @@ -30,20 +182,37 @@ __meta__ = { } [node name="NewGameButton" parent="VBoxContainer" instance=ExtResource( 1 )] +margin_right = 111.0 scene_to_load = "res://World.tscn" [node name="Label" parent="VBoxContainer/NewGameButton" index="0"] text = "New Game" -[node name="QuitButton" parent="VBoxContainer" instance=ExtResource( 1 )] +[node name="CreditsButton" parent="VBoxContainer" instance=ExtResource( 1 )] margin_top = 24.0 +margin_right = 111.0 margin_bottom = 44.0 +scene_to_load = "res://Menus/Credits/Credits.tscn" + +[node name="Label" parent="VBoxContainer/CreditsButton" index="0"] +text = "Credits" + +[node name="QuitButton" parent="VBoxContainer" instance=ExtResource( 1 )] +margin_top = 48.0 +margin_right = 111.0 +margin_bottom = 68.0 quit = true [node name="Label" parent="VBoxContainer/QuitButton" index="0"] text = "Quit" + +[node name="AnimationPlayer" type="AnimationPlayer" parent="."] +anims/__INIT__ = SubResource( 2 ) +anims/show_buttons = SubResource( 1 ) [connection signal="startup_finished" from="Startup" to="." method="_on_Startup_startup_finished"] [editable path="VBoxContainer/NewGameButton"] +[editable path="VBoxContainer/CreditsButton"] + [editable path="VBoxContainer/QuitButton"] diff --git a/src/project.godot b/src/project.godot index 7a449b1..ff90a7f 100644 --- a/src/project.godot +++ b/src/project.godot @@ -33,7 +33,7 @@ _global_script_class_icons={ [application] config/name="LD46 Game" -run/main_scene="res://World.tscn" +run/main_scene="res://Menus/TitleScreen/TitleScreen.tscn" config/icon="res://icon.png" [autoload] @@ -98,6 +98,12 @@ down={ , Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":1,"axis_value":1.0,"script":null) ] } +skip={ +"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":32,"unicode":0,"echo":false,"script":null) +, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":10,"pressure":0.0,"pressed":false,"script":null) + ] +} [layer_names]