Compare commits
6 commits
6c1523864d
...
204848fcf1
Author | SHA1 | Date | |
---|---|---|---|
204848fcf1 | |||
9619b8d346 | |||
05ff226721 | |||
![]() |
7b66e219b2 | ||
![]() |
c3d84f1e17 | ||
![]() |
2ae314b374 |
28 changed files with 530 additions and 15 deletions
|
@ -29,6 +29,7 @@ project/assembly_name="code-game-jam-drop-plafond-2025"
|
|||
|
||||
World_Border=""
|
||||
Enemies=""
|
||||
Player=""
|
||||
|
||||
[input]
|
||||
|
||||
|
|
34
ressources/images/mob-death-1.png.import
Normal file
34
ressources/images/mob-death-1.png.import
Normal file
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://c5lk8ab1g5anw"
|
||||
path="res://.godot/imported/mob-death-1.png-284462b68d775d41a0e5b3dea896c703.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://ressources/images/mob-death-1.png"
|
||||
dest_files=["res://.godot/imported/mob-death-1.png-284462b68d775d41a0e5b3dea896c703.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
|
34
ressources/images/mob-death-2.png.import
Normal file
34
ressources/images/mob-death-2.png.import
Normal file
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://c4fau2t7w8cll"
|
||||
path="res://.godot/imported/mob-death-2.png-6132e0c0c8563bd70a68d9b7f7638167.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://ressources/images/mob-death-2.png"
|
||||
dest_files=["res://.godot/imported/mob-death-2.png-6132e0c0c8563bd70a68d9b7f7638167.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
|
34
ressources/images/mob-death-3.png.import
Normal file
34
ressources/images/mob-death-3.png.import
Normal file
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://c446xwqg0ngk"
|
||||
path="res://.godot/imported/mob-death-3.png-94f44228dfb3bd0a9c4c288ef2c56b46.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://ressources/images/mob-death-3.png"
|
||||
dest_files=["res://.godot/imported/mob-death-3.png-94f44228dfb3bd0a9c4c288ef2c56b46.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
|
|
@ -1,4 +1,4 @@
|
|||
[gd_scene load_steps=15 format=3 uid="uid://durhes43gex7a"]
|
||||
[gd_scene load_steps=16 format=3 uid="uid://durhes43gex7a"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://c7bfiw54rvaq2" path="res://scenes/player_melodie.tscn" id="1_cl1wt"]
|
||||
[ext_resource type="Script" path="res://scenes/room.gd" id="1_jh83c"]
|
||||
|
@ -8,8 +8,9 @@
|
|||
[ext_resource type="Texture2D" uid="uid://bge3nllk1bq5r" path="res://ressources/images/mur.svg" id="3_oi2tl"]
|
||||
[ext_resource type="Texture2D" uid="uid://dhva3tivsvknl" path="res://ressources/images/mur_coin.svg" id="4_6a3f6"]
|
||||
[ext_resource type="PackedScene" uid="uid://di4chlep1t1or" path="res://parametres/menu_parametres.tscn" id="6_6ubhx"]
|
||||
[ext_resource type="PackedScene" uid="uid://cnd2a1x1smulq" path="res://scenes/interface.tscn" id="8_5s7tf"]
|
||||
[ext_resource type="PackedScene" uid="uid://bndtclt51nsih" path="res://scenes/interface.tscn" id="8_5s7tf"]
|
||||
[ext_resource type="PackedScene" uid="uid://ctgxrbcg2vu1p" path="res://scenes/ecran_mort.tscn" id="10_3ou8w"]
|
||||
[ext_resource type="PackedScene" uid="uid://cm5spgl8o4fam" path="res://scenes/enemies/robot.tscn" id="10_5qrsc"]
|
||||
|
||||
[sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_1c4te"]
|
||||
normal = Vector2(0, 1)
|
||||
|
@ -43,8 +44,9 @@ offset_bottom = 360.0
|
|||
texture = ExtResource("2_torsx")
|
||||
stretch_mode = 1
|
||||
|
||||
[node name="Player_Melodie" parent="." instance=ExtResource("1_cl1wt")]
|
||||
[node name="Player_Melodie" parent="." node_paths=PackedStringArray("interface") groups=["Player"] instance=ExtResource("1_cl1wt")]
|
||||
scale = Vector2(3, 3)
|
||||
interface = NodePath("../Interface")
|
||||
|
||||
[node name="StaticBody2D" type="StaticBody2D" parent="." groups=["World_Border"]]
|
||||
collision_layer = 3
|
||||
|
@ -157,5 +159,8 @@ offset_top = -383.0
|
|||
offset_right = -258.0
|
||||
offset_bottom = -383.0
|
||||
|
||||
[node name="Robot" parent="." groups=["Enemies"] instance=ExtResource("10_5qrsc")]
|
||||
position = Vector2(-428, 11)
|
||||
|
||||
[connection signal="finished" from="Musique" to="." method="_on_audio_stream_player_finished"]
|
||||
[connection signal="retour_menu" from="Ecran mort" to="." method="_on_ecran_mort_retour_menu"]
|
||||
|
|
|
@ -13,4 +13,5 @@ func _process(delta: float) -> void:
|
|||
|
||||
|
||||
func _on_main_menu_button_pressed() -> void:
|
||||
get_tree().paused = false
|
||||
retour_menu.emit()
|
||||
|
|
48
scenes/enemies/poulpe.gd
Normal file
48
scenes/enemies/poulpe.gd
Normal file
|
@ -0,0 +1,48 @@
|
|||
extends CharacterBody2D
|
||||
|
||||
const SPEED = 50.0
|
||||
@onready var player = get_parent().get_node("Player_Melodie")
|
||||
var player_position = Vector2.ZERO
|
||||
var target_position = Vector2.ZERO
|
||||
|
||||
var move_timer = 1
|
||||
|
||||
var vie = 3
|
||||
var balle = null
|
||||
var Balle = null
|
||||
|
||||
func _ready() -> void:
|
||||
Balle = load("res://scenes/enemies/poulpeBullet.tscn")
|
||||
|
||||
|
||||
func take_damage(dmg : int) :
|
||||
vie -= dmg
|
||||
if vie <= 0:
|
||||
queue_free()
|
||||
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
player_position = player.position
|
||||
target_position = (player_position - position).normalized()
|
||||
move_and_slide()
|
||||
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
var direction : Vector2
|
||||
move_timer -= delta
|
||||
|
||||
if move_timer < 0:
|
||||
attaquer_joueur()
|
||||
move_timer = 1
|
||||
|
||||
|
||||
$AnimatedSprite2D.play("Generic")
|
||||
|
||||
velocity = target_position * SPEED * -1
|
||||
|
||||
|
||||
func attaquer_joueur() -> void:
|
||||
balle = Balle.instantiate()
|
||||
balle.set_direction(target_position)
|
||||
balle.position = position
|
||||
get_parent().add_child(balle)
|
33
scenes/enemies/poulpe.tscn
Normal file
33
scenes/enemies/poulpe.tscn
Normal file
|
@ -0,0 +1,33 @@
|
|||
[gd_scene load_steps=6 format=3 uid="uid://voiqrkjd02om"]
|
||||
|
||||
[ext_resource type="Script" path="res://scenes/enemies/poulpe.gd" id="1_hu6wh"]
|
||||
[ext_resource type="Texture2D" uid="uid://2spn60rmdyy5" path="res://ressources/images/poulpe-1.png" id="1_lgwa7"]
|
||||
[ext_resource type="Texture2D" uid="uid://b4ukmsspx16f" path="res://ressources/images/poulpe-2.png" id="2_5x4i5"]
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_2hq77"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("1_lgwa7")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("2_5x4i5")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"Generic",
|
||||
"speed": 5.0
|
||||
}]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_s7foh"]
|
||||
radius = 38.2753
|
||||
|
||||
[node name="Poulpe" type="CharacterBody2D"]
|
||||
script = ExtResource("1_hu6wh")
|
||||
|
||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
|
||||
scale = Vector2(0.4, 0.4)
|
||||
sprite_frames = SubResource("SpriteFrames_2hq77")
|
||||
animation = &"Generic"
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
shape = SubResource("CircleShape2D_s7foh")
|
17
scenes/enemies/poulpeBullet.tscn
Normal file
17
scenes/enemies/poulpeBullet.tscn
Normal file
|
@ -0,0 +1,17 @@
|
|||
[gd_scene load_steps=3 format=3 uid="uid://gytt3e3u0pid"]
|
||||
|
||||
[ext_resource type="Script" path="res://scenes/enemies/poulpe_bullet.gd" id="1_qycm8"]
|
||||
[ext_resource type="Texture2D" uid="uid://bg7xknf5g2rfj" path="res://ressources/images/poulpe-bullet.png" id="2_o0wmh"]
|
||||
|
||||
[node name="PoulpeBullet" type="Area2D"]
|
||||
script = ExtResource("1_qycm8")
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
scale = Vector2(0.35, 0.35)
|
||||
texture = ExtResource("2_o0wmh")
|
||||
|
||||
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="."]
|
||||
scale = Vector2(0.35, 0.35)
|
||||
polygon = PackedVector2Array(-42, -44, -42, 43.2, -39.9, 44.3, -36.4, 42, -34.3, 42, -28, 6.2, -28, -1.4, -18, 7.89999, -18, 9.2, 23.5, 32, 28.8, 32, 32, 28.8, 32, 25.5, 18, 0.5, 18, -2.9, -6.8, -26.6, 19.4, -32, 32.4, -32, 41.4, -36, 43.2, -36, 44.3, -38.1, 42, -41.7, 42, -44)
|
||||
|
||||
[connection signal="body_entered" from="." to="." method="Collision"]
|
20
scenes/enemies/poulpe_bullet.gd
Normal file
20
scenes/enemies/poulpe_bullet.gd
Normal file
|
@ -0,0 +1,20 @@
|
|||
extends Area2D
|
||||
|
||||
var speed = 200.0
|
||||
var direction = Vector2.ZERO
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
position += direction * speed * delta
|
||||
|
||||
func set_direction(direction: Vector2) -> void:
|
||||
self.direction = direction
|
||||
|
||||
|
||||
func Collision(body: Node2D) -> void:
|
||||
if body.is_in_group("World_Border") :
|
||||
queue_free()
|
||||
if body.is_in_group("Player"):
|
||||
body.take_damage(3)
|
||||
queue_free()
|
||||
|
||||
|
48
scenes/enemies/robot.gd
Normal file
48
scenes/enemies/robot.gd
Normal file
|
@ -0,0 +1,48 @@
|
|||
extends CharacterBody2D
|
||||
|
||||
const SPEED = 50.0
|
||||
@onready var player = get_parent().get_node("Player_Melodie")
|
||||
var player_position = Vector2.ZERO
|
||||
var target_position = Vector2.ZERO
|
||||
|
||||
var move_timer = 1
|
||||
|
||||
var vie = 3
|
||||
var balle = null
|
||||
var Balle = null
|
||||
|
||||
func _ready() -> void:
|
||||
Balle = load("res://scenes/enemies/robotCercle.tscn")
|
||||
|
||||
|
||||
func take_damage(dmg : int) :
|
||||
vie -= dmg
|
||||
if vie <= 0:
|
||||
queue_free()
|
||||
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
player_position = player.position
|
||||
target_position = (player_position - position).normalized()
|
||||
move_and_slide()
|
||||
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
var direction : Vector2
|
||||
move_timer -= delta
|
||||
|
||||
if move_timer < 0:
|
||||
attaquer_joueur()
|
||||
move_timer = 1
|
||||
|
||||
|
||||
$AnimatedSprite2D.play("Generic")
|
||||
|
||||
velocity = target_position * SPEED
|
||||
|
||||
|
||||
func attaquer_joueur() -> void:
|
||||
balle = Balle.instantiate()
|
||||
balle.set_direction(target_position)
|
||||
balle.position = position
|
||||
get_parent().add_child(balle)
|
37
scenes/enemies/robot.tscn
Normal file
37
scenes/enemies/robot.tscn
Normal file
|
@ -0,0 +1,37 @@
|
|||
[gd_scene load_steps=7 format=3 uid="uid://cm5spgl8o4fam"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://dwwe0eanmrcra" path="res://ressources/images/roby-idle-0.png" id="1_mo3hb"]
|
||||
[ext_resource type="Script" path="res://scenes/enemies/robot.gd" id="1_tikkk"]
|
||||
[ext_resource type="Texture2D" uid="uid://8m84oe4oes3u" path="res://ressources/images/roby-idle-1.png" id="2_4n77m"]
|
||||
[ext_resource type="Texture2D" uid="uid://dcyf6teijpttj" path="res://ressources/images/roby-idle-2.png" id="3_8bmqk"]
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_vaeha"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("1_mo3hb")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("2_4n77m")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("3_8bmqk")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"Generic",
|
||||
"speed": 5.0
|
||||
}]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_utjf8"]
|
||||
size = Vector2(126, 185)
|
||||
|
||||
[node name="Robot" type="CharacterBody2D"]
|
||||
script = ExtResource("1_tikkk")
|
||||
|
||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
|
||||
sprite_frames = SubResource("SpriteFrames_vaeha")
|
||||
animation = &"Generic"
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
position = Vector2(-2, 6.5)
|
||||
shape = SubResource("RectangleShape2D_utjf8")
|
18
scenes/enemies/robotCercle.tscn
Normal file
18
scenes/enemies/robotCercle.tscn
Normal file
|
@ -0,0 +1,18 @@
|
|||
[gd_scene load_steps=4 format=3 uid="uid://bevw5uqw42vfh"]
|
||||
|
||||
[ext_resource type="Script" path="res://scenes/enemies/robot_cercle.gd" id="1_3gn1u"]
|
||||
[ext_resource type="Texture2D" uid="uid://b5ui24x0341jh" path="res://ressources/images/roby-cercle.png" id="2_j4tla"]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_6j0u0"]
|
||||
radius = 96.8762
|
||||
|
||||
[node name="Robotcercle" type="Area2D"]
|
||||
script = ExtResource("1_3gn1u")
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
texture = ExtResource("2_j4tla")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
shape = SubResource("CircleShape2D_6j0u0")
|
||||
|
||||
[connection signal="body_entered" from="." to="." method="Collision"]
|
19
scenes/enemies/robot_cercle.gd
Normal file
19
scenes/enemies/robot_cercle.gd
Normal file
|
@ -0,0 +1,19 @@
|
|||
extends Area2D
|
||||
|
||||
var direction = Vector2.ZERO
|
||||
var timer = 0.0
|
||||
var cooldown = 0.7
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
timer += delta
|
||||
if timer >= cooldown:
|
||||
queue_free()
|
||||
|
||||
|
||||
func set_direction(direction: Vector2) -> void:
|
||||
self.direction = direction
|
||||
|
||||
|
||||
func Collision(body: Node2D) -> void:
|
||||
if body.is_in_group("Player"):
|
||||
body.take_damage(3)
|
35
scenes/enemies/sli2D1.tmp
Normal file
35
scenes/enemies/sli2D1.tmp
Normal file
|
@ -0,0 +1,35 @@
|
|||
[gd_scene load_steps=6 format=3 uid="uid://cyvqa6g64cw37"]
|
||||
|
||||
[ext_resource type="Script" path="res://scenes/enemies/slime.gd" id="1_hnufy"]
|
||||
[ext_resource type="Texture2D" uid="uid://c85d5krtd4nks" path="res://ressources/images/blob-1.png" id="2_f4wf2"]
|
||||
[ext_resource type="Texture2D" uid="uid://c0b6d7551nbcm" path="res://ressources/images/blob-2-4.png" id="3_dyq42"]
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_qfla8"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("2_f4wf2")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("3_dyq42")
|
||||
}],
|
||||
"loop": false,
|
||||
"name": &"Generic",
|
||||
"speed": 3.0
|
||||
}]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_bokrm"]
|
||||
radius = 20.0
|
||||
|
||||
[node name="Slime" type="CharacterBody2D"]
|
||||
collision_layer = 3
|
||||
collision_mask = 3
|
||||
script = ExtResource("1_hnufy")
|
||||
|
||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
|
||||
scale = Vector2(0.2, 0.2)
|
||||
sprite_frames = SubResource("SpriteFrames_qfla8")
|
||||
animation = &"Generic"
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
shape = SubResource("CircleShape2D_bokrm")
|
35
scenes/enemies/sli97B9.tmp
Normal file
35
scenes/enemies/sli97B9.tmp
Normal file
|
@ -0,0 +1,35 @@
|
|||
[gd_scene load_steps=6 format=3 uid="uid://cyvqa6g64cw37"]
|
||||
|
||||
[ext_resource type="Script" path="res://scenes/enemies/slime.gd" id="1_hnufy"]
|
||||
[ext_resource type="Texture2D" uid="uid://c85d5krtd4nks" path="res://ressources/images/blob-1.png" id="2_f4wf2"]
|
||||
[ext_resource type="Texture2D" uid="uid://c0b6d7551nbcm" path="res://ressources/images/blob-2-4.png" id="3_dyq42"]
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_qfla8"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("2_f4wf2")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("3_dyq42")
|
||||
}],
|
||||
"loop": false,
|
||||
"name": &"Generic",
|
||||
"speed": 3.0
|
||||
}]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_bokrm"]
|
||||
radius = 20.0
|
||||
|
||||
[node name="Slime" type="CharacterBody2D"]
|
||||
collision_layer = 3
|
||||
collision_mask = 3
|
||||
script = ExtResource("1_hnufy")
|
||||
|
||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
|
||||
scale = Vector2(0.2, 0.2)
|
||||
sprite_frames = SubResource("SpriteFrames_qfla8")
|
||||
animation = &"Generic"
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
shape = SubResource("CircleShape2D_bokrm")
|
35
scenes/enemies/sliA92E.tmp
Normal file
35
scenes/enemies/sliA92E.tmp
Normal file
|
@ -0,0 +1,35 @@
|
|||
[gd_scene load_steps=6 format=3 uid="uid://cyvqa6g64cw37"]
|
||||
|
||||
[ext_resource type="Script" path="res://scenes/enemies/slime.gd" id="1_hnufy"]
|
||||
[ext_resource type="Texture2D" uid="uid://c85d5krtd4nks" path="res://ressources/images/blob-1.png" id="2_f4wf2"]
|
||||
[ext_resource type="Texture2D" uid="uid://c0b6d7551nbcm" path="res://ressources/images/blob-2-4.png" id="3_dyq42"]
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_qfla8"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("2_f4wf2")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("3_dyq42")
|
||||
}],
|
||||
"loop": false,
|
||||
"name": &"Generic",
|
||||
"speed": 3.0
|
||||
}]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_bokrm"]
|
||||
radius = 20.0
|
||||
|
||||
[node name="Slime" type="CharacterBody2D"]
|
||||
collision_layer = 3
|
||||
collision_mask = 3
|
||||
script = ExtResource("1_hnufy")
|
||||
|
||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
|
||||
scale = Vector2(0.2, 0.2)
|
||||
sprite_frames = SubResource("SpriteFrames_qfla8")
|
||||
animation = &"Generic"
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
shape = SubResource("CircleShape2D_bokrm")
|
35
scenes/enemies/sliDD95.tmp
Normal file
35
scenes/enemies/sliDD95.tmp
Normal file
|
@ -0,0 +1,35 @@
|
|||
[gd_scene load_steps=6 format=3 uid="uid://cyvqa6g64cw37"]
|
||||
|
||||
[ext_resource type="Script" path="res://scenes/enemies/slime.gd" id="1_hnufy"]
|
||||
[ext_resource type="Texture2D" uid="uid://c85d5krtd4nks" path="res://ressources/images/blob-1.png" id="2_f4wf2"]
|
||||
[ext_resource type="Texture2D" uid="uid://c0b6d7551nbcm" path="res://ressources/images/blob-2-4.png" id="3_dyq42"]
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_qfla8"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("2_f4wf2")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("3_dyq42")
|
||||
}],
|
||||
"loop": false,
|
||||
"name": &"Generic",
|
||||
"speed": 3.0
|
||||
}]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_bokrm"]
|
||||
radius = 20.0
|
||||
|
||||
[node name="Slime" type="CharacterBody2D"]
|
||||
collision_layer = 3
|
||||
collision_mask = 3
|
||||
script = ExtResource("1_hnufy")
|
||||
|
||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
|
||||
scale = Vector2(0.2, 0.2)
|
||||
sprite_frames = SubResource("SpriteFrames_qfla8")
|
||||
animation = &"Generic"
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
shape = SubResource("CircleShape2D_bokrm")
|
|
@ -7,14 +7,29 @@ var player_position = Vector2.ZERO
|
|||
var target_position = Vector2.ZERO
|
||||
|
||||
var move_timer = 2
|
||||
var next_degat = 1
|
||||
|
||||
var vie = 4
|
||||
|
||||
func take_damage(dmg : int) :
|
||||
vie -= dmg
|
||||
if vie <= 0:
|
||||
queue_free()
|
||||
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
player_position = player.position
|
||||
target_position = (player_position - position).normalized()
|
||||
move_and_slide()
|
||||
next_degat -= delta
|
||||
|
||||
for i in get_slide_collision_count():
|
||||
var collision = get_slide_collision(i)
|
||||
if collision.get_collider_shape().get_instance_id() == player.get_child(1).get_instance_id():
|
||||
if next_degat <= 0:
|
||||
player.take_damage(2)
|
||||
next_degat = 1
|
||||
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
var direction : Vector2
|
||||
|
|
|
@ -22,8 +22,8 @@ animations = [{
|
|||
radius = 20.0
|
||||
|
||||
[node name="Slime" type="CharacterBody2D"]
|
||||
collision_layer = 3
|
||||
collision_mask = 3
|
||||
collision_layer = 6
|
||||
collision_mask = 6
|
||||
script = ExtResource("1_hnufy")
|
||||
|
||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
|
||||
|
|
|
@ -25,7 +25,7 @@ func _process(delta: float) -> void:
|
|||
|
||||
func set_life(pv : int) -> void :
|
||||
var step = 1
|
||||
if pv > life :
|
||||
if pv < life :
|
||||
step = -1
|
||||
for i in range(life, pv, step):
|
||||
update_life(i)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
[gd_scene load_steps=4 format=3 uid="uid://cnd2a1x1smulq"]
|
||||
[gd_scene load_steps=4 format=3 uid="uid://bndtclt51nsih"]
|
||||
|
||||
[ext_resource type="Script" path="res://scenes/interface.gd" id="1_5p24o"]
|
||||
[ext_resource type="Texture2D" uid="uid://jyrl33rv1fnp" path="res://ressources/images/full_heart.svg" id="2_opn3r"]
|
||||
|
|
|
@ -8,6 +8,7 @@ radius = 6.0
|
|||
height = 32.0
|
||||
|
||||
[node name="Player_Melodie" type="CharacterBody2D"]
|
||||
collision_layer = 5
|
||||
script = ExtResource("1_7sg4g")
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
|
|
|
@ -50,3 +50,4 @@ func on_ecran_mort_retour_menu() -> void:
|
|||
|
||||
func on_death() -> void :
|
||||
mort.visible = true
|
||||
get_tree().paused = true
|
||||
|
|
|
@ -13,4 +13,6 @@ func Collision(body: Node2D) -> void:
|
|||
if body.is_in_group("World_Border") :
|
||||
queue_free()
|
||||
if body.is_in_group("Enemies") :
|
||||
body.take_damage(1)
|
||||
print(body.vie)
|
||||
queue_free()
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
extends Area2D
|
||||
|
||||
var timer = 0.0
|
||||
var cooldown = 0.35
|
||||
var cooldown = 0.3
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
timer += delta
|
||||
|
@ -9,6 +9,5 @@ func _process(delta: float) -> void:
|
|||
queue_free()
|
||||
|
||||
func Collision(body: Node2D) -> void:
|
||||
|
||||
if body.is_in_group("Enemies") :
|
||||
queue_free()
|
||||
body.take_damage(3)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
extends Area2D
|
||||
|
||||
var timer = 0.0
|
||||
var cooldown = 1.5
|
||||
var cooldown = 0.33
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
timer += delta
|
||||
|
@ -11,4 +11,4 @@ func _process(delta: float) -> void:
|
|||
|
||||
func Collision(body: Node2D) -> void:
|
||||
if body.is_in_group("Enemies") :
|
||||
queue_free()
|
||||
body.take_damage(2)
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
extends CharacterBody2D
|
||||
|
||||
@export var interface : Control
|
||||
|
||||
const move_speed = 400
|
||||
const acceleration = 0.25
|
||||
const max_boost_speed = 800
|
||||
|
@ -19,19 +21,22 @@ var flute_cooldown = 0.5
|
|||
var tambour_cooldown = 3.0
|
||||
var lyre_cooldown = 1
|
||||
|
||||
var slot = [null, null]
|
||||
var slot = []
|
||||
var slotstr = []
|
||||
|
||||
var vie = 10
|
||||
|
||||
func _ready() -> void:
|
||||
flute = load("res://scripts/Instrument/Flute.gd").new()
|
||||
flute.set_scene_parent(get_tree().get_root())
|
||||
slot.append(flute)
|
||||
|
||||
tambour = load("res://scripts/Instrument/Tambour.gd").new()
|
||||
tambour.set_scene_parent(get_tree().get_root())
|
||||
|
||||
lyre = load("res://scripts/Instrument/Lyre.gd").new()
|
||||
lyre.set_scene_parent(get_tree().get_root())
|
||||
slot.append(lyre)
|
||||
|
||||
|
||||
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
|
@ -99,3 +104,6 @@ func _process(delta: float) -> void:
|
|||
lyre_timer = lyre_cooldown
|
||||
|
||||
|
||||
func take_damage(dmg : int) :
|
||||
vie -= dmg
|
||||
interface.set_life(vie)
|
||||
|
|
Loading…
Add table
Reference in a new issue