diff --git a/assets/ui/startscreen.aseprite b/assets/ui/startscreen.aseprite new file mode 100644 index 0000000..3780961 Binary files /dev/null and b/assets/ui/startscreen.aseprite differ diff --git a/assets/ui/startscreen.png b/assets/ui/startscreen.png new file mode 100644 index 0000000..21d617f Binary files /dev/null and b/assets/ui/startscreen.png differ diff --git a/assets/ui/startscreen.png.import b/assets/ui/startscreen.png.import new file mode 100644 index 0000000..e31a87b --- /dev/null +++ b/assets/ui/startscreen.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/startscreen.png-d7a6273392897ce5197005cc2ccf9315.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/ui/startscreen.png" +dest_files=[ "res://.import/startscreen.png-d7a6273392897ce5197005cc2ccf9315.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=false +svg/scale=1.0 diff --git a/project.godot b/project.godot index 182ef1f..7233db2 100644 --- a/project.godot +++ b/project.godot @@ -21,7 +21,7 @@ _global_script_class_icons={ [application] config/name="Coloroid" -run/main_scene="res://scenes/levels/main.tscn" +run/main_scene="res://scenes/main_menu.tscn" config/icon="res://icon.png" [autoload] diff --git a/scenes/main_menu.gd b/scenes/main_menu.gd new file mode 100644 index 0000000..1d9bb93 --- /dev/null +++ b/scenes/main_menu.gd @@ -0,0 +1,13 @@ +extends Node2D + +func _ready(): + music.play(music.BACKGROUND) + +func _input(event): + if Input.is_action_just_pressed("jump"): + var transition = get_tree().get_nodes_in_group("transition")[0] + transition.connect("fade_complete", self, "_load_main_level") + transition.begin_fade() + +func _load_main_level(): + get_tree().change_scene("res://scenes/levels/main.tscn") diff --git a/scenes/main_menu.tscn b/scenes/main_menu.tscn new file mode 100644 index 0000000..431103d --- /dev/null +++ b/scenes/main_menu.tscn @@ -0,0 +1,16 @@ +[gd_scene load_steps=4 format=2] + +[ext_resource path="res://scenes/transition.tscn" type="PackedScene" id=1] +[ext_resource path="res://assets/ui/startscreen.png" type="Texture" id=2] +[ext_resource path="res://scenes/main_menu.gd" type="Script" id=3] + +[node name="main_menu" type="Node2D"] +script = ExtResource( 3 ) + +[node name="CanvasLayer" type="CanvasLayer" parent="."] + +[node name="Startscreen" type="Sprite" parent="CanvasLayer"] +position = Vector2( 160, 90 ) +texture = ExtResource( 2 ) + +[node name="transition" parent="." instance=ExtResource( 1 )]