ajout intrument
This commit is contained in:
parent
84f3b91978
commit
5ee577d733
11 changed files with 328 additions and 1 deletions
8
Instrument/Corde.gd
Normal file
8
Instrument/Corde.gd
Normal file
|
@ -0,0 +1,8 @@
|
|||
extends Instrument
|
||||
class_name Corde
|
||||
|
||||
func _init(nom : String) -> void:
|
||||
super(nom)
|
||||
|
||||
func pincer() -> void:
|
||||
print("On pince l'instrument %s." % nom)
|
19
Instrument/Flute.gd
Normal file
19
Instrument/Flute.gd
Normal file
|
@ -0,0 +1,19 @@
|
|||
extends Vent
|
||||
|
||||
var Balle = preload("res://scenes/attaques/Balle.tscn").instantiate() # Charger le nœud Balle
|
||||
|
||||
func _init() -> void:
|
||||
super("Flûte")
|
||||
|
||||
func jouer_melodie(player_position) -> void:
|
||||
print("La flûte joue une mélodie.")
|
||||
jouer()
|
||||
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é.")
|
9
Instrument/Instrument.gd
Normal file
9
Instrument/Instrument.gd
Normal file
|
@ -0,0 +1,9 @@
|
|||
class_name Instrument
|
||||
|
||||
var nom : String
|
||||
|
||||
func _init(nom : String) -> void:
|
||||
self.nom = nom
|
||||
|
||||
func jouer() -> void:
|
||||
print("L'instrument %s est joué." % nom)
|
9
Instrument/Percusson.gd
Normal file
9
Instrument/Percusson.gd
Normal file
|
@ -0,0 +1,9 @@
|
|||
extends Instrument
|
||||
class_name Percussion
|
||||
|
||||
|
||||
func _init(nom : String) -> void:
|
||||
super(nom)
|
||||
|
||||
func frapper() -> void:
|
||||
print("On frappe l'instrument %s." % nom)
|
8
Instrument/Tambour.gd
Normal file
8
Instrument/Tambour.gd
Normal file
|
@ -0,0 +1,8 @@
|
|||
extends Percussion
|
||||
|
||||
func _init() -> void:
|
||||
super("Tambour")
|
||||
|
||||
func faire_roulement() -> void:
|
||||
print("Le tambour fait un roulement.")
|
||||
jouer()
|
8
Instrument/Vent.gd
Normal file
8
Instrument/Vent.gd
Normal file
|
@ -0,0 +1,8 @@
|
|||
extends Instrument
|
||||
class_name Vent
|
||||
|
||||
func _init(nom : String) -> void:
|
||||
super(nom)
|
||||
|
||||
func souffler() -> void:
|
||||
print("On souffle dans l'instrument %s." % nom)
|
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]
|
||||
|
||||
|
|
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
|
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)
|
|
@ -6,6 +6,11 @@ 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()
|
||||
flute._init()
|
||||
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
|
@ -28,5 +33,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