Merge branch 'main' of https://forgejo.la-taniere-solidaire.gay/renarde/code-game-jam-drop-plafond-2025
This commit is contained in:
commit
f10063de24
18 changed files with 424 additions and 7 deletions
16
Instrument/Flute.gd
Normal file
16
Instrument/Flute.gd
Normal file
|
@ -0,0 +1,16 @@
|
|||
class_name Flute
|
||||
|
||||
var Balle = preload("res://scenes/attaques/Balle.tscn").instantiate() # Charger le nœud Balle
|
||||
|
||||
|
||||
func jouer_melodie(player_position) -> void:
|
||||
print("La flûte joue une mélodie.")
|
||||
spawn_balle(player_position)
|
||||
|
||||
|
||||
func spawn_balle(player_position) -> void:
|
||||
# Assurez-vous que vous ajoutez la balle comme enfant dans une scène appropriée
|
||||
if Balle:
|
||||
Balle.position = player_position # Place la balle à la position actuelle du joueur
|
||||
else:
|
||||
print("Erreur : la création de la balle a échoué.")
|
5
Instrument/Tambour.gd
Normal file
5
Instrument/Tambour.gd
Normal file
|
@ -0,0 +1,5 @@
|
|||
class_name Tambour
|
||||
|
||||
|
||||
func faire_roulement() -> void:
|
||||
print("Le tambour fait un roulement.")
|
207
menu_principal/men576D.tmp
Normal file
207
menu_principal/men576D.tmp
Normal file
|
@ -0,0 +1,207 @@
|
|||
[gd_scene load_steps=8 format=3 uid="uid://bmwgfrd8butry"]
|
||||
|
||||
[ext_resource type="Script" path="res://menu_principal/menu_principal_affichage.gd" id="1_10mja"]
|
||||
[ext_resource type="Texture2D" uid="uid://dqfrqntx73do5" path="res://ressources/images/menu_jeu_button.svg" id="1_502q6"]
|
||||
[ext_resource type="Texture2D" uid="uid://d2coddkrmcpy5" path="res://ressources/images/cgj_base_menu.svg" id="2_16gd3"]
|
||||
[ext_resource type="Texture2D" uid="uid://kpss4kt07w8l" path="res://ressources/images/menu_jeu_button_survole.svg" id="2_b8slo"]
|
||||
[ext_resource type="Texture2D" uid="uid://c5q7bc5hpe6hd" path="res://ressources/images/menu_jeu_tiny_button.svg" id="3_o6osq"]
|
||||
[ext_resource type="Texture2D" uid="uid://1pxsc65es708" path="res://ressources/images/menu_jeu_tiny_button_survole.svg" id="4_egxbj"]
|
||||
[ext_resource type="PackedScene" uid="uid://di4chlep1t1or" path="res://parametres/menu_parametres.tscn" id="6_0lenm"]
|
||||
|
||||
[node name="Menu_principal_affichage" 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_10mja")
|
||||
|
||||
[node name="ImageFond" type="TextureRect" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
texture = ExtResource("2_16gd3")
|
||||
|
||||
[node name="Menu_principal" type="MarginContainer" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme_override_constants/margin_left = 12
|
||||
theme_override_constants/margin_top = 12
|
||||
theme_override_constants/margin_right = 12
|
||||
theme_override_constants/margin_bottom = 12
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="Menu_principal"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 93
|
||||
|
||||
[node name="VSeparator" type="VSeparator" parent="Menu_principal/HBoxContainer"]
|
||||
modulate = Color(1, 1, 1, 0)
|
||||
self_modulate = Color(1, 1, 1, 0)
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = -200
|
||||
|
||||
[node name="VBoxMainButton" type="VBoxContainer" parent="Menu_principal/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 48
|
||||
|
||||
[node name="HSeparator" type="HSeparator" parent="Menu_principal/HBoxContainer/VBoxMainButton"]
|
||||
modulate = Color(0, 0, 0, 0)
|
||||
self_modulate = Color(1, 1, 1, 0)
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="play_button" type="TextureButton" parent="Menu_principal/HBoxContainer/VBoxMainButton"]
|
||||
custom_minimum_size = Vector2(248, 0)
|
||||
layout_mode = 2
|
||||
texture_normal = ExtResource("1_502q6")
|
||||
texture_pressed = ExtResource("2_b8slo")
|
||||
texture_hover = ExtResource("2_b8slo")
|
||||
texture_disabled = ExtResource("2_b8slo")
|
||||
texture_focused = ExtResource("2_b8slo")
|
||||
stretch_mode = 0
|
||||
|
||||
[node name="play_label" type="Label" parent="Menu_principal/HBoxContainer/VBoxMainButton/play_button"]
|
||||
modulate = Color(0, 0, 0, 1)
|
||||
layout_mode = 0
|
||||
offset_right = 256.0
|
||||
offset_bottom = 128.0
|
||||
theme_override_font_sizes/font_size = 32
|
||||
text = "Jouer"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
language = "fr_FR"
|
||||
|
||||
[node name="load_button" type="TextureButton" parent="Menu_principal/HBoxContainer/VBoxMainButton"]
|
||||
layout_mode = 2
|
||||
texture_normal = ExtResource("1_502q6")
|
||||
texture_pressed = ExtResource("2_b8slo")
|
||||
texture_hover = ExtResource("2_b8slo")
|
||||
texture_focused = ExtResource("2_b8slo")
|
||||
stretch_mode = 0
|
||||
|
||||
[node name="load_label" type="Label" parent="Menu_principal/HBoxContainer/VBoxMainButton/load_button"]
|
||||
modulate = Color(0, 0, 0, 1)
|
||||
layout_mode = 0
|
||||
offset_right = 256.0
|
||||
offset_bottom = 128.0
|
||||
theme_override_font_sizes/font_size = 32
|
||||
text = "Charger
|
||||
"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
language = "fr_FR"
|
||||
|
||||
[node name="quit_button" type="TextureButton" parent="Menu_principal/HBoxContainer/VBoxMainButton"]
|
||||
layout_mode = 2
|
||||
texture_normal = ExtResource("1_502q6")
|
||||
texture_pressed = ExtResource("2_b8slo")
|
||||
texture_hover = ExtResource("2_b8slo")
|
||||
texture_focused = ExtResource("2_b8slo")
|
||||
stretch_mode = 0
|
||||
|
||||
[node name="quit_label" type="Label" parent="Menu_principal/HBoxContainer/VBoxMainButton/quit_button"]
|
||||
modulate = Color(0, 0, 0, 1)
|
||||
layout_mode = 0
|
||||
offset_right = 256.0
|
||||
offset_bottom = 128.0
|
||||
theme_override_font_sizes/font_size = 32
|
||||
text = "Quitter"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
language = "fr_FR"
|
||||
|
||||
[node name="HSeparator2" type="HSeparator" parent="Menu_principal/HBoxContainer/VBoxMainButton"]
|
||||
modulate = Color(0, 0, 0, 0)
|
||||
self_modulate = Color(1, 1, 1, 0)
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="VSeparator2" type="VSeparator" parent="Menu_principal/HBoxContainer"]
|
||||
modulate = Color(1, 1, 1, 0)
|
||||
self_modulate = Color(1, 1, 1, 0)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="VBoxSideButton" type="VBoxContainer" parent="Menu_principal/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 30
|
||||
|
||||
[node name="HSeparator" type="HSeparator" parent="Menu_principal/HBoxContainer/VBoxSideButton"]
|
||||
modulate = Color(1, 1, 1, 0)
|
||||
self_modulate = Color(1, 1, 1, 0)
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
theme_override_constants/separation = 355
|
||||
|
||||
[node name="param_button" type="TextureButton" parent="Menu_principal/HBoxContainer/VBoxSideButton"]
|
||||
custom_minimum_size = Vector2(150, 128)
|
||||
layout_mode = 2
|
||||
texture_normal = ExtResource("3_o6osq")
|
||||
texture_pressed = ExtResource("4_egxbj")
|
||||
texture_hover = ExtResource("4_egxbj")
|
||||
texture_focused = ExtResource("4_egxbj")
|
||||
stretch_mode = 0
|
||||
|
||||
[node name="param_label" type="Label" parent="Menu_principal/HBoxContainer/VBoxSideButton/param_button"]
|
||||
modulate = Color(0, 0, 0, 1)
|
||||
layout_mode = 0
|
||||
offset_top = 27.0
|
||||
offset_right = 150.0
|
||||
offset_bottom = 91.0
|
||||
theme_override_font_sizes/font_size = 19
|
||||
text = "Paramètres"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
language = "fr_FR"
|
||||
|
||||
[node name="credit_button" type="TextureButton" parent="Menu_principal/HBoxContainer/VBoxSideButton"]
|
||||
custom_minimum_size = Vector2(0, 128)
|
||||
layout_mode = 2
|
||||
texture_normal = ExtResource("3_o6osq")
|
||||
texture_pressed = ExtResource("4_egxbj")
|
||||
texture_hover = ExtResource("4_egxbj")
|
||||
texture_focused = ExtResource("4_egxbj")
|
||||
stretch_mode = 0
|
||||
|
||||
[node name="credit_label" type="Label" parent="Menu_principal/HBoxContainer/VBoxSideButton/credit_button"]
|
||||
modulate = Color(0, 0, 0, 1)
|
||||
layout_mode = 0
|
||||
offset_top = 28.0
|
||||
offset_right = 150.0
|
||||
offset_bottom = 92.0
|
||||
theme_override_font_sizes/font_size = 25
|
||||
text = "Crédits"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
language = "fr_FR"
|
||||
|
||||
[node name="HSeparator2" type="HSeparator" parent="Menu_principal/HBoxContainer/VBoxSideButton"]
|
||||
modulate = Color(1, 1, 1, 0)
|
||||
self_modulate = Color(1, 1, 1, 0)
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 10
|
||||
|
||||
[node name="VSeparator3" type="VSeparator" parent="Menu_principal/HBoxContainer"]
|
||||
modulate = Color(1, 1, 1, 0)
|
||||
self_modulate = Color(1, 1, 1, 0)
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Menu_parametres" parent="." instance=ExtResource("6_0lenm")]
|
||||
visible = false
|
||||
layout_mode = 1
|
||||
|
||||
[node name="MusiqueFond" type="AudioStreamPlayer" parent="."]
|
||||
autoplay = true
|
||||
|
||||
[connection signal="pressed" from="Menu_principal/HBoxContainer/VBoxMainButton/play_button" to="." method="_on_play_button_pressed"]
|
||||
[connection signal="pressed" from="Menu_principal/HBoxContainer/VBoxMainButton/load_button" to="." method="_on_load_button_pressed"]
|
||||
[connection signal="pressed" from="Menu_principal/HBoxContainer/VBoxMainButton/quit_button" to="." method="_on_quit_button_pressed"]
|
||||
[connection signal="pressed" from="Menu_principal/HBoxContainer/VBoxSideButton/param_button" to="." method="_on_param_button_pressed"]
|
|
@ -52,6 +52,11 @@ PAUSE={
|
|||
"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":0,"physical_keycode":4194305,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
JOUER_MUSIQUE={
|
||||
"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":32,"key_label":0,"unicode":32,"location":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
|
||||
[rendering]
|
||||
|
||||
|
|
BIN
ressources/images/blob.png
Normal file
BIN
ressources/images/blob.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
34
ressources/images/blob.png.import
Normal file
34
ressources/images/blob.png.import
Normal file
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://mv8rmdodurqi"
|
||||
path="res://.godot/imported/blob.png-1a313cac5d7156c396b2de174c4d8808.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://ressources/images/blob.png"
|
||||
dest_files=["res://.godot/imported/blob.png-1a313cac5d7156c396b2de174c4d8808.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
|
BIN
ressources/images/note1.png
Normal file
BIN
ressources/images/note1.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 203 B |
34
ressources/images/note1.png.import
Normal file
34
ressources/images/note1.png.import
Normal file
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://csbrejwjfkspr"
|
||||
path="res://.godot/imported/note1.png-96f27d997f75f6c14a701aa9df88a950.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://ressources/images/note1.png"
|
||||
dest_files=["res://.godot/imported/note1.png-96f27d997f75f6c14a701aa9df88a950.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
|
BIN
ressources/images/note2.png
Normal file
BIN
ressources/images/note2.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 203 B |
34
ressources/images/note2.png.import
Normal file
34
ressources/images/note2.png.import
Normal file
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://1xayae6jyuge"
|
||||
path="res://.godot/imported/note2.png-7ddebed95ea93b6f57090ac58466a01e.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://ressources/images/note2.png"
|
||||
dest_files=["res://.godot/imported/note2.png-7ddebed95ea93b6f57090ac58466a01e.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
|
BIN
ressources/images/note3.png
Normal file
BIN
ressources/images/note3.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 203 B |
34
ressources/images/note3.png.import
Normal file
34
ressources/images/note3.png.import
Normal file
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://btqqmug6qex0d"
|
||||
path="res://.godot/imported/note3.png-3a2fd90f8e888d278f8e7c03cb67db73.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://ressources/images/note3.png"
|
||||
dest_files=["res://.godot/imported/note3.png-3a2fd90f8e888d278f8e7c03cb67db73.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
|
BIN
ressources/sons/tambour.mp3
Normal file
BIN
ressources/sons/tambour.mp3
Normal file
Binary file not shown.
19
ressources/sons/tambour.mp3.import
Normal file
19
ressources/sons/tambour.mp3.import
Normal file
|
@ -0,0 +1,19 @@
|
|||
[remap]
|
||||
|
||||
importer="mp3"
|
||||
type="AudioStreamMP3"
|
||||
uid="uid://y631cuj1gxus"
|
||||
path="res://.godot/imported/tambour.mp3-674d8c190e28a91f37bfb684cfb61f18.mp3str"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://ressources/sons/tambour.mp3"
|
||||
dest_files=["res://.godot/imported/tambour.mp3-674d8c190e28a91f37bfb684cfb61f18.mp3str"]
|
||||
|
||||
[params]
|
||||
|
||||
loop=false
|
||||
loop_offset=0
|
||||
bpm=0
|
||||
beat_count=0
|
||||
bar_beats=4
|
|
@ -1,6 +1,7 @@
|
|||
[gd_scene load_steps=6 format=3 uid="uid://durhes43gex7a"]
|
||||
[gd_scene load_steps=7 format=3 uid="uid://durhes43gex7a"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://c7bfiw54rvaq2" path="res://scenes/player_melodie.tscn" id="1_cl1wt"]
|
||||
[ext_resource type="Texture2D" uid="uid://ky4e7158gqf6" path="res://ressources/images/cgj_default_tile.svg" id="2_torsx"]
|
||||
|
||||
[sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_1c4te"]
|
||||
normal = Vector2(0, 1)
|
||||
|
@ -19,7 +20,16 @@ distance = -640.0
|
|||
|
||||
[node name="Room" type="Node2D"]
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="."]
|
||||
offset_left = -640.0
|
||||
offset_top = -360.0
|
||||
offset_right = 640.0
|
||||
offset_bottom = 360.0
|
||||
texture = ExtResource("2_torsx")
|
||||
stretch_mode = 1
|
||||
|
||||
[node name="Player_Melodie" parent="." instance=ExtResource("1_cl1wt")]
|
||||
scale = Vector2(4, 4)
|
||||
|
||||
[node name="StaticBody2D" type="StaticBody2D" parent="."]
|
||||
|
||||
|
|
13
scenes/attaques/Balle.tscn
Normal file
13
scenes/attaques/Balle.tscn
Normal file
|
@ -0,0 +1,13 @@
|
|||
[gd_scene load_steps=2 format=3 uid="uid://btpp8l4efhrmj"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://ge7xtkpw6hgb" path="res://ressources/images/note1.png" id="1_qx664"]
|
||||
|
||||
[node name="Balle1" type="CharacterBody2D"]
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
rotation = 3.14159
|
||||
texture = ExtResource("1_qx664")
|
||||
|
||||
[node name="RayCast2D" type="RayCast2D" parent="."]
|
||||
position = Vector2(0, -7)
|
||||
target_position = Vector2(0, 15)
|
|
@ -1,17 +1,17 @@
|
|||
[gd_scene load_steps=4 format=3 uid="uid://c7bfiw54rvaq2"]
|
||||
|
||||
[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"]
|
||||
[ext_resource type="Texture2D" uid="uid://uebyv8y862vt" path="res://ressources/images/melodie.svg" id="2_se13h"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_uwwdc"]
|
||||
size = Vector2(32, 32)
|
||||
size = Vector2(16, 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")
|
||||
scale = Vector2(0.75, 0.75)
|
||||
texture = ExtResource("2_se13h")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
shape = SubResource("RectangleShape2D_uwwdc")
|
||||
|
|
|
@ -6,6 +6,10 @@ const max_boost_speed = 800
|
|||
|
||||
var previous_direction = Vector2.ZERO
|
||||
var boost_speed = 0
|
||||
var flute = null
|
||||
|
||||
func _ready() -> void:
|
||||
flute = load("res://Instrument/Flute.gd").new()
|
||||
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
|
@ -20,7 +24,7 @@ func _process(delta: float) -> void:
|
|||
if direction != Vector2.ZERO:
|
||||
if direction.normalized() == previous_direction.normalized():
|
||||
if direction.x != 0 and direction.y != 0:
|
||||
boost_speed = min(boost_speed + acceleration / 8, (max_boost_speed - move_speed) / 8)
|
||||
boost_speed = min(boost_speed + acceleration / 16, (max_boost_speed - move_speed) / 8)
|
||||
else:
|
||||
boost_speed = min(boost_speed + acceleration, max_boost_speed - move_speed)
|
||||
else:
|
||||
|
@ -28,5 +32,7 @@ func _process(delta: float) -> void:
|
|||
|
||||
previous_direction = direction
|
||||
velocity = direction * (move_speed + boost_speed)
|
||||
print(velocity)
|
||||
|
||||
if Input.is_action_just_pressed("JOUER_MUSIQUE"):
|
||||
flute.jouer_melodie(position)
|
||||
pass
|
||||
|
|
Loading…
Add table
Reference in a new issue