feat: integrated some assets and made a hitbox and damage reaction system
This commit is contained in:
BIN
ennemy/IdleMechant.png
(Stored with Git LFS)
Normal file
BIN
ennemy/IdleMechant.png
(Stored with Git LFS)
Normal file
Binary file not shown.
34
ennemy/IdleMechant.png.import
Normal file
34
ennemy/IdleMechant.png.import
Normal file
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://3g48672b8541"
|
||||
path="res://.godot/imported/IdleMechant.png-ced0ec4bedd0a649c483c7992abb82fc.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://ennemy/IdleMechant.png"
|
||||
dest_files=["res://.godot/imported/IdleMechant.png-ced0ec4bedd0a649c483c7992abb82fc.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
ennemy/MechantVol.png
(Stored with Git LFS)
Normal file
BIN
ennemy/MechantVol.png
(Stored with Git LFS)
Normal file
Binary file not shown.
34
ennemy/MechantVol.png.import
Normal file
34
ennemy/MechantVol.png.import
Normal file
@ -0,0 +1,34 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cjruk5xlt3tyn"
|
||||
path="res://.godot/imported/MechantVol.png-92fe77e69a79007327da2f7de078b743.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://ennemy/MechantVol.png"
|
||||
dest_files=["res://.godot/imported/MechantVol.png-92fe77e69a79007327da2f7de078b743.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,6 +1,11 @@
|
||||
extends CharacterBody2D
|
||||
|
||||
@onready var animated_sprite: AnimatedSprite2D = $AnimatedSprite2D
|
||||
@onready var time_to_finish_hit: Timer = $TimeToFinishHit
|
||||
@onready var hitbox: Area2D = $Hitbox
|
||||
|
||||
func _ready() -> void:
|
||||
hitbox.monitoring = false
|
||||
|
||||
func play_anim_run():
|
||||
animated_sprite.play("run")
|
||||
@ -10,3 +15,13 @@ func play_anim_idle():
|
||||
|
||||
func hit():
|
||||
animated_sprite.play("hit")
|
||||
time_to_finish_hit.start()
|
||||
hitbox.monitoring = true
|
||||
|
||||
func _on_trigger_hit_body_entered(body: Node2D) -> void:
|
||||
if body.name == "Player":
|
||||
hit()
|
||||
|
||||
func _on_time_to_finish_hit_timeout() -> void:
|
||||
play_anim_idle()
|
||||
hitbox.monitoring = false
|
||||
|
||||
@ -1,18 +1,52 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://c5ruphrd8ebuu"]
|
||||
[gd_scene load_steps=8 format=3 uid="uid://c5ruphrd8ebuu"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dailpwkay2nu5" path="res://ennemy/armored_ennemy.gd" id="1_f4v0e"]
|
||||
[ext_resource type="SpriteFrames" uid="uid://i6035vm5ited" path="res://player/armored_spritesheet.tres" id="1_k1sc2"]
|
||||
[ext_resource type="Shape2D" uid="uid://6rhdwj5jxbxn" path="res://player/player_collision.tres" id="2_f4v0e"]
|
||||
[ext_resource type="PackedScene" uid="uid://7sqwi3lygb1u" path="res://damageable/hitbox.tscn" id="4_e5h8j"]
|
||||
[ext_resource type="AudioStream" uid="uid://c0w61do2a1hbc" path="res://ennemy/black-magic-159868.mp3" id="5_iblih"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_f4v0e"]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_e5h8j"]
|
||||
|
||||
[node name="ArmoredEnnemy" type="CharacterBody2D"]
|
||||
script = ExtResource("1_f4v0e")
|
||||
|
||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
|
||||
position = Vector2(1, -28)
|
||||
position = Vector2(1, -16)
|
||||
sprite_frames = ExtResource("1_k1sc2")
|
||||
animation = &"jump"
|
||||
animation = &"idle"
|
||||
autoplay = "idle"
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
position = Vector2(0, -13)
|
||||
shape = ExtResource("2_f4v0e")
|
||||
|
||||
[node name="TriggerHit" type="Area2D" parent="."]
|
||||
collision_mask = 2
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="TriggerHit"]
|
||||
position = Vector2(17, -15)
|
||||
shape = SubResource("RectangleShape2D_f4v0e")
|
||||
|
||||
[node name="Hitbox" parent="." instance=ExtResource("4_e5h8j")]
|
||||
collision_mask = 3
|
||||
hitback_direction = Vector2(1, -1)
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox"]
|
||||
position = Vector2(17, -15)
|
||||
shape = SubResource("CircleShape2D_e5h8j")
|
||||
|
||||
[node name="TimeToFinishHit" type="Timer" parent="."]
|
||||
wait_time = 0.5
|
||||
one_shot = true
|
||||
|
||||
[node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="."]
|
||||
stream = ExtResource("5_iblih")
|
||||
autoplay = true
|
||||
max_distance = 400.0
|
||||
bus = &"SFX"
|
||||
|
||||
[connection signal="body_entered" from="TriggerHit" to="." method="_on_trigger_hit_body_entered"]
|
||||
[connection signal="timeout" from="TimeToFinishHit" to="." method="_on_time_to_finish_hit_timeout"]
|
||||
|
||||
BIN
ennemy/black-magic-159868.mp3
(Stored with Git LFS)
Normal file
BIN
ennemy/black-magic-159868.mp3
(Stored with Git LFS)
Normal file
Binary file not shown.
19
ennemy/black-magic-159868.mp3.import
Normal file
19
ennemy/black-magic-159868.mp3.import
Normal file
@ -0,0 +1,19 @@
|
||||
[remap]
|
||||
|
||||
importer="mp3"
|
||||
type="AudioStreamMP3"
|
||||
uid="uid://c0w61do2a1hbc"
|
||||
path="res://.godot/imported/black-magic-159868.mp3-f5e04e11025cfff3fcd9a08fe133af57.mp3str"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://ennemy/black-magic-159868.mp3"
|
||||
dest_files=["res://.godot/imported/black-magic-159868.mp3-f5e04e11025cfff3fcd9a08fe133af57.mp3str"]
|
||||
|
||||
[params]
|
||||
|
||||
loop=true
|
||||
loop_offset=0.0
|
||||
bpm=0.0
|
||||
beat_count=0
|
||||
bar_beats=4
|
||||
Reference in New Issue
Block a user