diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..8ad74f7 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Normalize EOL for all files that Git considers text files. +* text=auto eol=lf diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4709183 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +# Godot 4+ specific ignores +.godot/ diff --git a/assets/images/player/up0.png b/assets/images/player/up0.png new file mode 100644 index 0000000..5255b6a Binary files /dev/null and b/assets/images/player/up0.png differ diff --git a/assets/images/player/up0.png.import b/assets/images/player/up0.png.import new file mode 100644 index 0000000..146137a --- /dev/null +++ b/assets/images/player/up0.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bk7g7e8esssyj" +path="res://.godot/imported/up0.png-4580acbbbb818077d9dbad1c8a7407d9.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/images/player/up0.png" +dest_files=["res://.godot/imported/up0.png-4580acbbbb818077d9dbad1c8a7407d9.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/assets/images/player/up1.png b/assets/images/player/up1.png new file mode 100644 index 0000000..883fff5 Binary files /dev/null and b/assets/images/player/up1.png differ diff --git a/assets/images/player/up1.png.import b/assets/images/player/up1.png.import new file mode 100644 index 0000000..e74956b --- /dev/null +++ b/assets/images/player/up1.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dqhbikc2p5eqy" +path="res://.godot/imported/up1.png-1de7a5905e226f04b662042be34b490d.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/images/player/up1.png" +dest_files=["res://.godot/imported/up1.png-1de7a5905e226f04b662042be34b490d.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/assets/images/player/up2.png b/assets/images/player/up2.png new file mode 100644 index 0000000..c41f45a Binary files /dev/null and b/assets/images/player/up2.png differ diff --git a/assets/images/player/up2.png.import b/assets/images/player/up2.png.import new file mode 100644 index 0000000..667586e --- /dev/null +++ b/assets/images/player/up2.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://d3kwb3cf58ano" +path="res://.godot/imported/up2.png-c4a837a2c4ff3ad544e0ebb3341118e7.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/images/player/up2.png" +dest_files=["res://.godot/imported/up2.png-c4a837a2c4ff3ad544e0ebb3341118e7.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/assets/images/player/walk0.png b/assets/images/player/walk0.png new file mode 100644 index 0000000..5255b6a Binary files /dev/null and b/assets/images/player/walk0.png differ diff --git a/assets/images/player/walk0.png.import b/assets/images/player/walk0.png.import new file mode 100644 index 0000000..011a1ab --- /dev/null +++ b/assets/images/player/walk0.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cnhmnm7ow2ctf" +path="res://.godot/imported/walk0.png-ab763d16cff6d356dc7f06964c8188b9.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/images/player/walk0.png" +dest_files=["res://.godot/imported/walk0.png-ab763d16cff6d356dc7f06964c8188b9.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/assets/images/player/walk1.png b/assets/images/player/walk1.png new file mode 100644 index 0000000..ce004c1 Binary files /dev/null and b/assets/images/player/walk1.png differ diff --git a/assets/images/player/walk1.png.import b/assets/images/player/walk1.png.import new file mode 100644 index 0000000..9ffd424 --- /dev/null +++ b/assets/images/player/walk1.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c6xq71q8k2ghg" +path="res://.godot/imported/walk1.png-047c0a79d2edbe2ead93896829d8b8cc.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/images/player/walk1.png" +dest_files=["res://.godot/imported/walk1.png-047c0a79d2edbe2ead93896829d8b8cc.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/assets/images/player/walk2.png b/assets/images/player/walk2.png new file mode 100644 index 0000000..2c537d5 Binary files /dev/null and b/assets/images/player/walk2.png differ diff --git a/assets/images/player/walk2.png.import b/assets/images/player/walk2.png.import new file mode 100644 index 0000000..3b6eb04 --- /dev/null +++ b/assets/images/player/walk2.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cjertn5iyqktu" +path="res://.godot/imported/walk2.png-e5452d5b4bcea2f2ef8e130d22878999.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/images/player/walk2.png" +dest_files=["res://.godot/imported/walk2.png-e5452d5b4bcea2f2ef8e130d22878999.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/entity/Player.gd b/entity/Player.gd new file mode 100644 index 0000000..4443590 --- /dev/null +++ b/entity/Player.gd @@ -0,0 +1,36 @@ +extends Area2D + +@export var speed = 400 +var screen_size + +# Called when the node enters the scene tree for the first time. +func _ready(): + screen_size = get_viewport_rect().size + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta): + var velocity = Vector2.ZERO # The player's movement vector. + if Input.is_action_pressed("move_right"): + velocity.x += 1 + if Input.is_action_pressed("move_left"): + velocity.x -= 1 + if Input.is_action_pressed("move_down"): + velocity.y += 1 + if Input.is_action_pressed("move_up"): + velocity.y -= 1 + + if velocity.length() > 0: + velocity = velocity.normalized() * speed + $AnimatedSprite2D.play() + else: + $AnimatedSprite2D.stop() + + position += velocity * delta + position = position.clamp(Vector2(15,15), Vector2(960-15,1080-15)) + + if velocity.x != 0: + $AnimatedSprite2D.animation = "walk" + $AnimatedSprite2D.flip_h = velocity.x < 0 + elif velocity.y != 0: + $AnimatedSprite2D.animation = "up" diff --git a/entity/player.tscn b/entity/player.tscn new file mode 100644 index 0000000..7f9cffe --- /dev/null +++ b/entity/player.tscn @@ -0,0 +1,60 @@ +[gd_scene load_steps=10 format=3 uid="uid://djokiepdvy3r4"] + +[ext_resource type="Script" path="res://entity/Player.gd" id="1_wbhmb"] +[ext_resource type="Texture2D" uid="uid://bk7g7e8esssyj" path="res://assets/images/player/up0.png" id="2_lkbqe"] +[ext_resource type="Texture2D" uid="uid://dqhbikc2p5eqy" path="res://assets/images/player/up1.png" id="3_81m7d"] +[ext_resource type="Texture2D" uid="uid://d3kwb3cf58ano" path="res://assets/images/player/up2.png" id="4_oshyc"] +[ext_resource type="Texture2D" uid="uid://cnhmnm7ow2ctf" path="res://assets/images/player/walk0.png" id="5_yac28"] +[ext_resource type="Texture2D" uid="uid://c6xq71q8k2ghg" path="res://assets/images/player/walk1.png" id="6_cbt57"] +[ext_resource type="Texture2D" uid="uid://cjertn5iyqktu" path="res://assets/images/player/walk2.png" id="7_4ok0f"] + +[sub_resource type="SpriteFrames" id="SpriteFrames_7ynwm"] +animations = [{ +"frames": [{ +"duration": 1.0, +"texture": ExtResource("2_lkbqe") +}, { +"duration": 1.0, +"texture": ExtResource("3_81m7d") +}, { +"duration": 1.0, +"texture": ExtResource("2_lkbqe") +}, { +"duration": 1.0, +"texture": ExtResource("4_oshyc") +}], +"loop": true, +"name": &"up", +"speed": 10.0 +}, { +"frames": [{ +"duration": 1.0, +"texture": ExtResource("5_yac28") +}, { +"duration": 1.0, +"texture": ExtResource("6_cbt57") +}, { +"duration": 1.0, +"texture": ExtResource("5_yac28") +}, { +"duration": 1.0, +"texture": ExtResource("7_4ok0f") +}], +"loop": true, +"name": &"walk", +"speed": 10.0 +}] + +[sub_resource type="CircleShape2D" id="CircleShape2D_cvy7c"] + +[node name="Player" type="Area2D"] +script = ExtResource("1_wbhmb") +metadata/_edit_group_ = true + +[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."] +sprite_frames = SubResource("SpriteFrames_7ynwm") +animation = &"walk" +frame_progress = 0.583416 + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +shape = SubResource("CircleShape2D_cvy7c") diff --git a/fonts/DotGothic16/DotGothic16-Regular.ttf b/fonts/DotGothic16/DotGothic16-Regular.ttf new file mode 100644 index 0000000..18b0c1e Binary files /dev/null and b/fonts/DotGothic16/DotGothic16-Regular.ttf differ diff --git a/fonts/DotGothic16/DotGothic16-Regular.ttf.import b/fonts/DotGothic16/DotGothic16-Regular.ttf.import new file mode 100644 index 0000000..2181418 --- /dev/null +++ b/fonts/DotGothic16/DotGothic16-Regular.ttf.import @@ -0,0 +1,33 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://q5lv1cuadoq5" +path="res://.godot/imported/DotGothic16-Regular.ttf-069a1b166703c125b46d2980133280d9.fontdata" + +[deps] + +source_file="res://fonts/DotGothic16/DotGothic16-Regular.ttf" +dest_files=["res://.godot/imported/DotGothic16-Regular.ttf-069a1b166703c125b46d2980133280d9.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=false +multichannel_signed_distance_field=false +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +hinting=1 +subpixel_positioning=1 +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/fonts/DotGothic16/OFL.txt b/fonts/DotGothic16/OFL.txt new file mode 100644 index 0000000..118ae3a --- /dev/null +++ b/fonts/DotGothic16/OFL.txt @@ -0,0 +1,93 @@ +Copyright 2020 The DotGothic16 Project Authors (https://github.com/fontworks-fonts/DotGothic16) + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/icon.svg b/icon.svg new file mode 100644 index 0000000..b370ceb --- /dev/null +++ b/icon.svg @@ -0,0 +1 @@ + diff --git a/icon.svg.import b/icon.svg.import new file mode 100644 index 0000000..39cf7fb --- /dev/null +++ b/icon.svg.import @@ -0,0 +1,37 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://batjspk5vxm30" +path="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://icon.svg" +dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/project.godot b/project.godot new file mode 100644 index 0000000..ba96147 --- /dev/null +++ b/project.godot @@ -0,0 +1,59 @@ +; Engine configuration file. +; It's best edited using the editor UI and not directly, +; since the parameters that go here are not all obvious. +; +; Format: +; [section] ; section goes between [] +; param=value ; assign values to parameters + +config_version=5 + +[application] + +config/name="th-kibi" +run/main_scene="res://scene/title.tscn" +config/features=PackedStringArray("4.2", "GL Compatibility") +config/icon="res://icon.svg" + +[display] + +window/size/viewport_width=1440 +window/size/viewport_height=1080 +window/stretch/mode="canvas_items" +window/stretch/aspect="expand" + +[input] + +ui_accept={ +"deadzone": 0.5, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194309,"physical_keycode":0,"key_label":0,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194310,"physical_keycode":0,"key_label":0,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":32,"physical_keycode":0,"key_label":0,"unicode":32,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":90,"key_label":0,"unicode":122,"echo":false,"script":null) +] +} +move_up={ +"deadzone": 0.5, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194320,"key_label":0,"unicode":0,"echo":false,"script":null) +] +} +move_down={ +"deadzone": 0.5, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194322,"key_label":0,"unicode":0,"echo":false,"script":null) +] +} +move_left={ +"deadzone": 0.5, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194319,"key_label":0,"unicode":0,"echo":false,"script":null) +] +} +move_right={ +"deadzone": 0.5, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194321,"key_label":0,"unicode":0,"echo":false,"script":null) +] +} + +[rendering] + +renderer/rendering_method="gl_compatibility" +renderer/rendering_method.mobile="gl_compatibility" diff --git a/scene/stage_1.gd b/scene/stage_1.gd new file mode 100644 index 0000000..e08925d --- /dev/null +++ b/scene/stage_1.gd @@ -0,0 +1,11 @@ +extends Node + + +# Called when the node enters the scene tree for the first time. +func _ready(): + pass # Replace with function body. + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta): + pass diff --git a/scene/stage_1.tscn b/scene/stage_1.tscn new file mode 100644 index 0000000..b9b5312 --- /dev/null +++ b/scene/stage_1.tscn @@ -0,0 +1,12 @@ +[gd_scene load_steps=4 format=3 uid="uid://t4bkano14bq8"] + +[ext_resource type="PackedScene" uid="uid://djokiepdvy3r4" path="res://entity/player.tscn" id="1_iklq5"] +[ext_resource type="Script" path="res://scene/stage_1.gd" id="1_xsra1"] +[ext_resource type="PackedScene" uid="uid://c1u2s2e48w4pd" path="res://ui/game_ui.tscn" id="2_j74kp"] + +[node name="Stage1" type="Node"] +script = ExtResource("1_xsra1") + +[node name="Player" parent="." instance=ExtResource("1_iklq5")] + +[node name="GameUI" parent="." instance=ExtResource("2_j74kp")] diff --git a/scene/title.gd b/scene/title.gd new file mode 100644 index 0000000..63def90 --- /dev/null +++ b/scene/title.gd @@ -0,0 +1,22 @@ +extends CanvasLayer + + +# Called when the node enters the scene tree for the first time. +func _ready(): + $MarginContainer/VBoxContainer/Start.grab_focus() + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta): + if Input.is_action_just_pressed("ui_cancel"): + var quitBtn = $MarginContainer/VBoxContainer/Quit + if quitBtn.has_focus(): + _on_quit_pressed() + quitBtn.grab_focus() + +func enableExtra(): + $MarginContainer/VBoxContainer/Extra.disabled = false + $MarginContainer/VBoxContainer/Extra.focus_mode = 2 + + +func _on_quit_pressed(): + get_tree().quit() diff --git a/scene/title.tscn b/scene/title.tscn new file mode 100644 index 0000000..3bfb1e6 --- /dev/null +++ b/scene/title.tscn @@ -0,0 +1,166 @@ +[gd_scene load_steps=4 format=3 uid="uid://bqyi0a4fcs563"] + +[ext_resource type="Script" path="res://scene/title.gd" id="1_5j3g0"] +[ext_resource type="FontFile" uid="uid://q5lv1cuadoq5" path="res://fonts/DotGothic16/DotGothic16-Regular.ttf" id="2_bf5un"] + +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_tokxl"] + +[node name="Title" type="CanvasLayer"] +script = ExtResource("1_5j3g0") + +[node name="MarginContainer" type="MarginContainer" parent="."] +anchors_preset = 3 +anchor_left = 1.0 +anchor_top = 1.0 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_left = -140.0 +offset_top = -324.0 +grow_horizontal = 0 +grow_vertical = 0 +theme_override_constants/margin_right = 20 +theme_override_constants/margin_bottom = 40 + +[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer"] +layout_mode = 2 + +[node name="Start" type="Button" parent="MarginContainer/VBoxContainer"] +layout_mode = 2 +size_flags_vertical = 3 +focus_neighbor_top = NodePath("../Quit") +theme_override_colors/font_pressed_color = Color(1, 0.682353, 0, 1) +theme_override_colors/font_hover_color = Color(0.580392, 0, 0, 1) +theme_override_colors/font_focus_color = Color(1, 0, 0, 1) +theme_override_colors/font_disabled_color = Color(0.372549, 0.372549, 0.372549, 1) +theme_override_colors/font_outline_color = Color(0, 0, 0, 1) +theme_override_constants/outline_size = 20 +theme_override_fonts/font = ExtResource("2_bf5un") +theme_override_font_sizes/font_size = 50 +theme_override_styles/focus = SubResource("StyleBoxEmpty_tokxl") +text = "Start" +flat = true +alignment = 0 + +[node name="Extra" type="Button" parent="MarginContainer/VBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 5 +size_flags_vertical = 3 +focus_mode = 0 +theme_override_colors/font_pressed_color = Color(1, 0.682353, 0, 1) +theme_override_colors/font_hover_color = Color(0.580392, 0, 0, 1) +theme_override_colors/font_focus_color = Color(1, 0, 0, 1) +theme_override_colors/font_disabled_color = Color(0.372549, 0.372549, 0.372549, 1) +theme_override_colors/font_outline_color = Color(0, 0, 0, 1) +theme_override_constants/outline_size = 20 +theme_override_fonts/font = ExtResource("2_bf5un") +theme_override_font_sizes/font_size = 50 +theme_override_styles/focus = SubResource("StyleBoxEmpty_tokxl") +disabled = true +text = "Extra Start" +flat = true +alignment = 0 + +[node name="Practice" type="Button" parent="MarginContainer/VBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 5 +size_flags_vertical = 3 +theme_override_colors/font_pressed_color = Color(1, 0.682353, 0, 1) +theme_override_colors/font_hover_color = Color(0.580392, 0, 0, 1) +theme_override_colors/font_focus_color = Color(1, 0, 0, 1) +theme_override_colors/font_disabled_color = Color(0.372549, 0.372549, 0.372549, 1) +theme_override_colors/font_outline_color = Color(0, 0, 0, 1) +theme_override_constants/outline_size = 20 +theme_override_fonts/font = ExtResource("2_bf5un") +theme_override_font_sizes/font_size = 50 +theme_override_styles/focus = SubResource("StyleBoxEmpty_tokxl") +text = "Practice Start" +flat = true +alignment = 0 + +[node name="Replay" type="Button" parent="MarginContainer/VBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 5 +size_flags_vertical = 3 +theme_override_colors/font_pressed_color = Color(1, 0.682353, 0, 1) +theme_override_colors/font_hover_color = Color(0.580392, 0, 0, 1) +theme_override_colors/font_focus_color = Color(1, 0, 0, 1) +theme_override_colors/font_disabled_color = Color(0.372549, 0.372549, 0.372549, 1) +theme_override_colors/font_outline_color = Color(0, 0, 0, 1) +theme_override_constants/outline_size = 20 +theme_override_fonts/font = ExtResource("2_bf5un") +theme_override_font_sizes/font_size = 50 +theme_override_styles/focus = SubResource("StyleBoxEmpty_tokxl") +text = "Replay" +flat = true +alignment = 0 + +[node name="Score" type="Button" parent="MarginContainer/VBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 5 +size_flags_vertical = 3 +theme_override_colors/font_pressed_color = Color(1, 0.682353, 0, 1) +theme_override_colors/font_hover_color = Color(0.580392, 0, 0, 1) +theme_override_colors/font_focus_color = Color(1, 0, 0, 1) +theme_override_colors/font_disabled_color = Color(0.372549, 0.372549, 0.372549, 1) +theme_override_colors/font_outline_color = Color(0, 0, 0, 1) +theme_override_constants/outline_size = 20 +theme_override_fonts/font = ExtResource("2_bf5un") +theme_override_font_sizes/font_size = 50 +theme_override_styles/focus = SubResource("StyleBoxEmpty_tokxl") +text = "Score" +flat = true +alignment = 0 + +[node name="Music" type="Button" parent="MarginContainer/VBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 5 +size_flags_vertical = 3 +theme_override_colors/font_pressed_color = Color(1, 0.682353, 0, 1) +theme_override_colors/font_hover_color = Color(0.580392, 0, 0, 1) +theme_override_colors/font_focus_color = Color(1, 0, 0, 1) +theme_override_colors/font_disabled_color = Color(0.372549, 0.372549, 0.372549, 1) +theme_override_colors/font_outline_color = Color(0, 0, 0, 1) +theme_override_constants/outline_size = 20 +theme_override_fonts/font = ExtResource("2_bf5un") +theme_override_font_sizes/font_size = 50 +theme_override_styles/focus = SubResource("StyleBoxEmpty_tokxl") +text = "Music Room" +flat = true +alignment = 0 + +[node name="Option" type="Button" parent="MarginContainer/VBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 5 +size_flags_vertical = 3 +theme_override_colors/font_pressed_color = Color(1, 0.682353, 0, 1) +theme_override_colors/font_hover_color = Color(0.580392, 0, 0, 1) +theme_override_colors/font_focus_color = Color(1, 0, 0, 1) +theme_override_colors/font_disabled_color = Color(0.372549, 0.372549, 0.372549, 1) +theme_override_colors/font_outline_color = Color(0, 0, 0, 1) +theme_override_constants/outline_size = 20 +theme_override_fonts/font = ExtResource("2_bf5un") +theme_override_font_sizes/font_size = 50 +theme_override_styles/focus = SubResource("StyleBoxEmpty_tokxl") +text = "Option" +flat = true +alignment = 0 + +[node name="Quit" type="Button" parent="MarginContainer/VBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 5 +size_flags_vertical = 3 +focus_neighbor_bottom = NodePath("../Start") +theme_override_colors/font_pressed_color = Color(1, 0.682353, 0, 1) +theme_override_colors/font_hover_color = Color(0.580392, 0, 0, 1) +theme_override_colors/font_focus_color = Color(1, 0, 0, 1) +theme_override_colors/font_disabled_color = Color(0.372549, 0.372549, 0.372549, 1) +theme_override_colors/font_outline_color = Color(0, 0, 0, 1) +theme_override_constants/outline_size = 20 +theme_override_fonts/font = ExtResource("2_bf5un") +theme_override_font_sizes/font_size = 50 +theme_override_styles/focus = SubResource("StyleBoxEmpty_tokxl") +text = "Quit" +flat = true +alignment = 0 + +[connection signal="pressed" from="MarginContainer/VBoxContainer/Quit" to="." method="_on_quit_pressed"] diff --git a/ui/game_ui.gd b/ui/game_ui.gd new file mode 100644 index 0000000..aaf93b9 --- /dev/null +++ b/ui/game_ui.gd @@ -0,0 +1,15 @@ +extends CanvasLayer + + +# Called when the node enters the scene tree for the first time. +func _ready(): + pass + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta): + pass + +func _on_viewport_size_changed(): + # Do whatever you need to do when the window changes! + print ("Viewport size changed") diff --git a/ui/game_ui.tscn b/ui/game_ui.tscn new file mode 100644 index 0000000..3ea5fac --- /dev/null +++ b/ui/game_ui.tscn @@ -0,0 +1,31 @@ +[gd_scene load_steps=4 format=3 uid="uid://c1u2s2e48w4pd"] + +[ext_resource type="Script" path="res://ui/game_ui.gd" id="1_ritbu"] + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_vehpn"] +bg_color = Color(0, 0.65098, 0.882353, 1) + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_bsuwx"] +bg_color = Color(1, 0.262745, 0.615686, 1) + +[node name="GameUI" type="CanvasLayer"] +script = ExtResource("1_ritbu") + +[node name="Panel" type="Panel" parent="."] +custom_minimum_size = Vector2(480, 0) +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_left = 960.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_styles/panel = SubResource("StyleBoxFlat_vehpn") + +[node name="Panel2" type="Panel" parent="."] +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_top = 1080.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_styles/panel = SubResource("StyleBoxFlat_bsuwx")