From 31ee3550af6a09018ffa3714512468417b4f503e Mon Sep 17 00:00:00 2001 From: Renarde-dev Date: Fri, 24 Jan 2025 13:20:45 +0100 Subject: [PATCH 1/2] Tiling system --- menu_principal/menu_principal_affichage.gd | 7 +-- project.godot | 2 +- ressources/images/cgj_default_tile.svg.import | 37 +++++++++++++++ ressources/images/cgj_tile_1.svg.import | 37 +++++++++++++++ ressources/images/cgj_tile_2.svg.import | 37 +++++++++++++++ scenes/Room.tscn | 45 +++++++++++-------- scenes/player_melodie.tscn | 8 ++-- 7 files changed, 147 insertions(+), 26 deletions(-) create mode 100644 ressources/images/cgj_default_tile.svg.import create mode 100644 ressources/images/cgj_tile_1.svg.import create mode 100644 ressources/images/cgj_tile_2.svg.import diff --git a/menu_principal/menu_principal_affichage.gd b/menu_principal/menu_principal_affichage.gd index c1731e0..e55ffde 100644 --- a/menu_principal/menu_principal_affichage.gd +++ b/menu_principal/menu_principal_affichage.gd @@ -3,6 +3,7 @@ extends Control @onready var menu_principal = $Menu_principal @onready var menu_parametres = $Menu_parametres +var first_room = preload("res://scenes/Room.tscn").instantiate() func _ready(): menu_parametres.exit_parametres.connect(on_exit_parametres) @@ -34,8 +35,8 @@ func on_exit_parametres() -> void : func _on_play_button_pressed(): - print("Jouer") - - + get_tree().root.add_child(first_room) + menu_principal.visible = false + func _on_load_button_pressed(): print("Charger une sauvegarde") diff --git a/project.godot b/project.godot index 0f99fdf..9da3292 100644 --- a/project.godot +++ b/project.godot @@ -11,7 +11,7 @@ config_version=5 [application] config/name="code-game-jam-drop-plafond-2025" -run/main_scene="res://scenes/Room.tscn" +run/main_scene="res://menu_principal/menu_principal_affichage.tscn" config/features=PackedStringArray("4.3", "GL Compatibility") config/icon="res://ressources/images/icon.svg" diff --git a/ressources/images/cgj_default_tile.svg.import b/ressources/images/cgj_default_tile.svg.import new file mode 100644 index 0000000..fd3bca7 --- /dev/null +++ b/ressources/images/cgj_default_tile.svg.import @@ -0,0 +1,37 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://d3781jh436rv5" +path="res://.godot/imported/cgj_default_tile.svg-6f24db072965547b576ce8b63fbe7ec8.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://ressources/images/cgj_default_tile.svg" +dest_files=["res://.godot/imported/cgj_default_tile.svg-6f24db072965547b576ce8b63fbe7ec8.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/ressources/images/cgj_tile_1.svg.import b/ressources/images/cgj_tile_1.svg.import new file mode 100644 index 0000000..b451b31 --- /dev/null +++ b/ressources/images/cgj_tile_1.svg.import @@ -0,0 +1,37 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bx7y5g64mwddk" +path="res://.godot/imported/cgj_tile_1.svg-6f1497fb2775a0586cdf5be113ac6ba6.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://ressources/images/cgj_tile_1.svg" +dest_files=["res://.godot/imported/cgj_tile_1.svg-6f1497fb2775a0586cdf5be113ac6ba6.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/ressources/images/cgj_tile_2.svg.import b/ressources/images/cgj_tile_2.svg.import new file mode 100644 index 0000000..6430939 --- /dev/null +++ b/ressources/images/cgj_tile_2.svg.import @@ -0,0 +1,37 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://3gcqt2o2g5yu" +path="res://.godot/imported/cgj_tile_2.svg-1008c878b662a507cf2fef633a6dc4aa.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://ressources/images/cgj_tile_2.svg" +dest_files=["res://.godot/imported/cgj_tile_2.svg-1008c878b662a507cf2fef633a6dc4aa.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/scenes/Room.tscn b/scenes/Room.tscn index 4f7d197..989978b 100644 --- a/scenes/Room.tscn +++ b/scenes/Room.tscn @@ -1,31 +1,40 @@ -[gd_scene load_steps=3 format=3 uid="uid://durhes43gex7a"] +[gd_scene load_steps=6 format=3 uid="uid://durhes43gex7a"] [ext_resource type="PackedScene" uid="uid://c7bfiw54rvaq2" path="res://scenes/player_melodie.tscn" id="1_cl1wt"] -[sub_resource type="RectangleShape2D" id="RectangleShape2D_18mp2"] -size = Vector2(1280, 720) +[sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_1c4te"] +normal = Vector2(0, 1) +distance = -360.0 + +[sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_qq3vn"] +distance = -360.0 + +[sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_e1nqi"] +normal = Vector2(-1, 0) +distance = -640.0 + +[sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_ia1hi"] +normal = Vector2(1, 0) +distance = -640.0 [node name="Room" type="Node2D"] [node name="Player_Melodie" parent="." instance=ExtResource("1_cl1wt")] -position = Vector2(0, -9) - -[node name="Camera2D" type="Camera2D" parent="."] [node name="StaticBody2D" type="StaticBody2D" parent="."] -[node name="Bottom Wall" type="CollisionShape2D" parent="StaticBody2D"] -position = Vector2(3, 721) -shape = SubResource("RectangleShape2D_18mp2") +[node name="World Border Up" type="CollisionShape2D" parent="StaticBody2D"] +shape = SubResource("WorldBoundaryShape2D_1c4te") -[node name="Top Wall" type="CollisionShape2D" parent="StaticBody2D"] -position = Vector2(0, -719) -shape = SubResource("RectangleShape2D_18mp2") +[node name="World Border Down" type="CollisionShape2D" parent="StaticBody2D"] +shape = SubResource("WorldBoundaryShape2D_qq3vn") -[node name="Left Wall" type="CollisionShape2D" parent="StaticBody2D"] -position = Vector2(-1278, -2) -shape = SubResource("RectangleShape2D_18mp2") +[node name="World Border Right" type="CollisionShape2D" parent="StaticBody2D"] +shape = SubResource("WorldBoundaryShape2D_e1nqi") -[node name="Right Wall" type="CollisionShape2D" parent="StaticBody2D"] -position = Vector2(1280, -4) -shape = SubResource("RectangleShape2D_18mp2") +[node name="World Border Left" type="CollisionShape2D" parent="StaticBody2D"] +shape = SubResource("WorldBoundaryShape2D_ia1hi") + +[node name="CanvasLayer" type="CanvasLayer" parent="."] + +[node name="Camera2D" type="Camera2D" parent="CanvasLayer"] diff --git a/scenes/player_melodie.tscn b/scenes/player_melodie.tscn index 2ee8b9b..f869238 100644 --- a/scenes/player_melodie.tscn +++ b/scenes/player_melodie.tscn @@ -3,15 +3,15 @@ [ext_resource type="Script" path="res://scripts/player_control.gd" id="1_7sg4g"] [ext_resource type="Texture2D" uid="uid://b4viqupj5q0je" path="res://ressources/images/icon.svg" id="1_w50ia"] -[sub_resource type="RectangleShape2D" id="RectangleShape2D_trcma"] -size = Vector2(122, 128) +[sub_resource type="RectangleShape2D" id="RectangleShape2D_uwwdc"] +size = Vector2(32, 32) [node name="Player_Melodie" type="CharacterBody2D"] script = ExtResource("1_7sg4g") [node name="Sprite2D" type="Sprite2D" parent="."] +scale = Vector2(0.25, 0.25) texture = ExtResource("1_w50ia") [node name="CollisionShape2D" type="CollisionShape2D" parent="."] -position = Vector2(-1, 0) -shape = SubResource("RectangleShape2D_trcma") +shape = SubResource("RectangleShape2D_uwwdc") From 34fe40f363e86f39ccc0bd97a1eb9b43d3a9f2f9 Mon Sep 17 00:00:00 2001 From: Renarde-dev Date: Fri, 24 Jan 2025 13:25:09 +0100 Subject: [PATCH 2/2] Merge ajout flute --- ressources/sons/flute-1.mp3.import | 19 +++++++++++++++++++ ressources/sons/flute-2.mp3.import | 19 +++++++++++++++++++ ressources/sons/flute-3.mp3.import | 19 +++++++++++++++++++ ressources/sons/flute-4.mp3.import | 19 +++++++++++++++++++ 4 files changed, 76 insertions(+) create mode 100644 ressources/sons/flute-1.mp3.import create mode 100644 ressources/sons/flute-2.mp3.import create mode 100644 ressources/sons/flute-3.mp3.import create mode 100644 ressources/sons/flute-4.mp3.import diff --git a/ressources/sons/flute-1.mp3.import b/ressources/sons/flute-1.mp3.import new file mode 100644 index 0000000..6756cf1 --- /dev/null +++ b/ressources/sons/flute-1.mp3.import @@ -0,0 +1,19 @@ +[remap] + +importer="mp3" +type="AudioStreamMP3" +uid="uid://cx13ty68wc35t" +path="res://.godot/imported/flute-1.mp3-10c7960bb7d4159ab8f40865ec6962ed.mp3str" + +[deps] + +source_file="res://ressources/sons/flute-1.mp3" +dest_files=["res://.godot/imported/flute-1.mp3-10c7960bb7d4159ab8f40865ec6962ed.mp3str"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 diff --git a/ressources/sons/flute-2.mp3.import b/ressources/sons/flute-2.mp3.import new file mode 100644 index 0000000..a41d339 --- /dev/null +++ b/ressources/sons/flute-2.mp3.import @@ -0,0 +1,19 @@ +[remap] + +importer="mp3" +type="AudioStreamMP3" +uid="uid://c11ka2t2bgxcw" +path="res://.godot/imported/flute-2.mp3-4a03f621dd2de901fb8e1a7b52032fe3.mp3str" + +[deps] + +source_file="res://ressources/sons/flute-2.mp3" +dest_files=["res://.godot/imported/flute-2.mp3-4a03f621dd2de901fb8e1a7b52032fe3.mp3str"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 diff --git a/ressources/sons/flute-3.mp3.import b/ressources/sons/flute-3.mp3.import new file mode 100644 index 0000000..8ddbd39 --- /dev/null +++ b/ressources/sons/flute-3.mp3.import @@ -0,0 +1,19 @@ +[remap] + +importer="mp3" +type="AudioStreamMP3" +uid="uid://batkr0188ug07" +path="res://.godot/imported/flute-3.mp3-a5b35f968497d4e9263ac5a99c064f66.mp3str" + +[deps] + +source_file="res://ressources/sons/flute-3.mp3" +dest_files=["res://.godot/imported/flute-3.mp3-a5b35f968497d4e9263ac5a99c064f66.mp3str"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 diff --git a/ressources/sons/flute-4.mp3.import b/ressources/sons/flute-4.mp3.import new file mode 100644 index 0000000..5ddb002 --- /dev/null +++ b/ressources/sons/flute-4.mp3.import @@ -0,0 +1,19 @@ +[remap] + +importer="mp3" +type="AudioStreamMP3" +uid="uid://djcir062icefh" +path="res://.godot/imported/flute-4.mp3-46468a714c037a41164c895e62130123.mp3str" + +[deps] + +source_file="res://ressources/sons/flute-4.mp3" +dest_files=["res://.godot/imported/flute-4.mp3-46468a714c037a41164c895e62130123.mp3str"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4