From 03ce3755f5f2cb7fdf72be1c98ee08865862967c Mon Sep 17 00:00:00 2001 From: Manuel Date: Fri, 29 Sep 2023 18:12:38 +0200 Subject: [PATCH] Initial commit --- .gitattributes | 2 ++ .gitignore | 24 ++++++++++++++++++++ README.md | 1 + assets/.gitkeep | 0 export_presets.cfg | 38 +++++++++++++++++++++++++++++++ icon.svg | 1 + icon.svg.import | 37 ++++++++++++++++++++++++++++++ project.godot | 29 ++++++++++++++++++++++++ src/config.gd | 10 +++++++++ src/game/main.tscn | 3 +++ src/gui/menu/main.gd | 23 +++++++++++++++++++ src/gui/menu/main.tscn | 47 +++++++++++++++++++++++++++++++++++++++ src/gui/menu/options.gd | 11 +++++++++ src/gui/menu/options.tscn | 12 ++++++++++ src/score.gd | 7 ++++++ 15 files changed, 245 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 README.md create mode 100644 assets/.gitkeep create mode 100644 export_presets.cfg create mode 100644 icon.svg create mode 100644 icon.svg.import create mode 100644 project.godot create mode 100644 src/config.gd create mode 100644 src/game/main.tscn create mode 100644 src/gui/menu/main.gd create mode 100644 src/gui/menu/main.tscn create mode 100644 src/gui/menu/options.gd create mode 100644 src/gui/menu/options.tscn create mode 100644 src/score.gd 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..0dc6c7c --- /dev/null +++ b/.gitignore @@ -0,0 +1,24 @@ +# Godot 4+ specific ignores +.godot/ + +# Godot-specific ignores +.import/ + +# Ignore Godot addon directory for now to not bloat the repo +addons/ + +# Don't push our secrets +src/secrets.gd + +# Imported translations (automatically generated from CSV files) +*.translation + +# Mono-specific ignores +.mono/ +data_*/ +mono_crash.*.json + +# System/tool-specific ignores +.directory +.DS_Store +*~ diff --git a/README.md b/README.md new file mode 100644 index 0000000..8efecf6 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# LDJAM 54 diff --git a/assets/.gitkeep b/assets/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/export_presets.cfg b/export_presets.cfg new file mode 100644 index 0000000..4fbb459 --- /dev/null +++ b/export_presets.cfg @@ -0,0 +1,38 @@ +[preset.0] + +name="Web" +platform="Web" +runnable=true +dedicated_server=false +custom_features="" +export_filter="all_resources" +include_filter="" +exclude_filter="" +export_path="" +encryption_include_filters="" +encryption_exclude_filters="" +encrypt_pck=false +encrypt_directory=false +script_encryption_key="" + +[preset.0.options] + +custom_template/debug="" +custom_template/release="" +variant/extensions_support=false +vram_texture_compression/for_desktop=true +vram_texture_compression/for_mobile=false +html/export_icon=true +html/custom_html_shell="" +html/head_include="" +html/canvas_resize_policy=2 +html/focus_canvas_on_start=true +html/experimental_virtual_keyboard=false +progressive_web_app/enabled=false +progressive_web_app/offline_page="" +progressive_web_app/display=1 +progressive_web_app/orientation=0 +progressive_web_app/icon_144x144="" +progressive_web_app/icon_180x180="" +progressive_web_app/icon_512x512="" +progressive_web_app/background_color=Color(0, 0, 0, 1) diff --git a/icon.svg b/icon.svg new file mode 100644 index 0000000..adc26df --- /dev/null +++ b/icon.svg @@ -0,0 +1 @@ + diff --git a/icon.svg.import b/icon.svg.import new file mode 100644 index 0000000..f2b876d --- /dev/null +++ b/icon.svg.import @@ -0,0 +1,37 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://biesoky0wkqkf" +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/lossy_quality=0.7 +compress/hdr_compression=1 +compress/bptc_ldr=0 +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..b2301d8 --- /dev/null +++ b/project.godot @@ -0,0 +1,29 @@ +; 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="GameJamTemplate" +run/main_scene="res://src/gui/menu/main.tscn" +config/features=PackedStringArray("4.1", "Forward Plus") +config/icon="res://icon.svg" + +[dotnet] + +project/assembly_name="GameJamTemplate" + +[editor] + +version_control/plugin_name="GitPlugin" +version_control/autoload_on_startup=true + +[editor_plugins] + +enabled=PackedStringArray("res://addons/godot-git-plugin/plugin.cfg") diff --git a/src/config.gd b/src/config.gd new file mode 100644 index 0000000..39e7cc0 --- /dev/null +++ b/src/config.gd @@ -0,0 +1,10 @@ +extends Node + +class_name Config + +var secrets = preload("secrets.gd") + +var HighscoreServerAddr: String +var ApiToken: String +var ValKey: String + diff --git a/src/game/main.tscn b/src/game/main.tscn new file mode 100644 index 0000000..e01407e --- /dev/null +++ b/src/game/main.tscn @@ -0,0 +1,3 @@ +[gd_scene format=3 uid="uid://c8kt1wg57ypfl"] + +[node name="main" type="Node2D"] diff --git a/src/gui/menu/main.gd b/src/gui/menu/main.gd new file mode 100644 index 0000000..689d218 --- /dev/null +++ b/src/gui/menu/main.gd @@ -0,0 +1,23 @@ +extends Control + + +# Called when the node enters the scene tree for the first time. +func _ready(): + $VBoxContainer/StartButton.grab_focus() + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta): + pass + + +func _on_start_button_pressed():util + get_tree().change_scene("res://game/main.tscn") + + +func _on_options_button_pressed(): + var options = load("res://menu/options.tscn").instance() + get_tree().current_scene.add_child((options)) + +func _on_quit_button_pressed(): + get_tree().quit() diff --git a/src/gui/menu/main.tscn b/src/gui/menu/main.tscn new file mode 100644 index 0000000..828ba7c --- /dev/null +++ b/src/gui/menu/main.tscn @@ -0,0 +1,47 @@ +[gd_scene load_steps=2 format=3 uid="uid://bgtkxeh3lciik"] + +[ext_resource type="Script" path="res://src/gui/menu/main.gd" id="1_p5r7q"] + +[node name="Menu" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_p5r7q") + +[node name="VBoxContainer" type="VBoxContainer" parent="."] +layout_mode = 1 +anchors_preset = 8 +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +offset_left = -200.0 +offset_top = -44.0 +offset_right = 200.0 +offset_bottom = 156.0 +grow_horizontal = 2 +grow_vertical = 2 +alignment = 1 + +[node name="StartButton" type="Button" parent="VBoxContainer"] +layout_mode = 2 +focus_neighbor_top = NodePath("../QuitButton") +text = "Start! +" + +[node name="OptionsButton" type="Button" parent="VBoxContainer"] +layout_mode = 2 +text = "Options +" + +[node name="QuitButton" type="Button" parent="VBoxContainer"] +layout_mode = 2 +focus_neighbor_bottom = NodePath("../StartButton") +text = "Quit" + +[connection signal="pressed" from="VBoxContainer/StartButton" to="." method="_on_start_button_pressed"] +[connection signal="pressed" from="VBoxContainer/OptionsButton" to="." method="_on_options_button_pressed"] +[connection signal="pressed" from="VBoxContainer/QuitButton" to="." method="_on_quit_button_pressed"] diff --git a/src/gui/menu/options.gd b/src/gui/menu/options.gd new file mode 100644 index 0000000..a1bbfe7 --- /dev/null +++ b/src/gui/menu/options.gd @@ -0,0 +1,11 @@ +extends Control + + +# 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/src/gui/menu/options.tscn b/src/gui/menu/options.tscn new file mode 100644 index 0000000..d5ca166 --- /dev/null +++ b/src/gui/menu/options.tscn @@ -0,0 +1,12 @@ +[gd_scene load_steps=2 format=3 uid="uid://fqg6y7xp34u0"] + +[ext_resource type="Script" path="res://src/gui/menu/options.gd" id="1_0813x"] + +[node name="options" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_0813x") diff --git a/src/score.gd b/src/score.gd new file mode 100644 index 0000000..995c82f --- /dev/null +++ b/src/score.gd @@ -0,0 +1,7 @@ +extends Node + +class_name Score + +var Name: String +var Score: int +var Game: String