added green attack, enemy

This commit is contained in:
Daniel Kauss Serna 2026-03-13 17:10:47 +01:00
parent f852b0a30e
commit 2bf9db610e
43 changed files with 673 additions and 246 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View file

@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bbmtfih341ity"
path="res://.godot/imported/green_(plum)-1.png-22cd1470484c6173ae53d1ef684a6437.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/enemies/green_(plum)-1.png"
dest_files=["res://.godot/imported/green_(plum)-1.png-22cd1470484c6173ae53d1ef684a6437.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
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/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View file

@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://binu4ig8dwobe"
path="res://.godot/imported/green_(plum)-2.png-230e98a177f64dc497a947cde74f887d.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/enemies/green_(plum)-2.png"
dest_files=["res://.godot/imported/green_(plum)-2.png-230e98a177f64dc497a947cde74f887d.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
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/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View file

@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://c2dgywtcsuicp"
path="res://.godot/imported/green_(plum)-3.png-07906798e9ceae22e47607e93e4b2206.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/enemies/green_(plum)-3.png"
dest_files=["res://.godot/imported/green_(plum)-3.png-07906798e9ceae22e47607e93e4b2206.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
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/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View file

@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bpf15ye4rok7r"
path="res://.godot/imported/green_(plum)-4.png-1317bc28e773a2d3a57d216d227e35ac.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/enemies/green_(plum)-4.png"
dest_files=["res://.godot/imported/green_(plum)-4.png-1317bc28e773a2d3a57d216d227e35ac.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
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/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View file

@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://qdsru1doca2w"
path="res://.godot/imported/green_left-1.png-e582bd353b5ef1a43382e9722113879d.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/enemies/green_left-1.png"
dest_files=["res://.godot/imported/green_left-1.png-e582bd353b5ef1a43382e9722113879d.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
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/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View file

@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://c4bv6nkd41o32"
path="res://.godot/imported/green_left-2.png-8ef4ff2663bd76a3aa8f1577bfaf54ee.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/enemies/green_left-2.png"
dest_files=["res://.godot/imported/green_left-2.png-8ef4ff2663bd76a3aa8f1577bfaf54ee.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
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/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View file

@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://nqy6loyw8sg8"
path="res://.godot/imported/green_left-3.png-ab6b0e535c24f691e7cecec29e84fdce.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/enemies/green_left-3.png"
dest_files=["res://.godot/imported/green_left-3.png-ab6b0e535c24f691e7cecec29e84fdce.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
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/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
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

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

View file

@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dlbo3mcxuw7fx"
path="res://.godot/imported/green_right.png-d334b23992f11797db1b71df5396cdf7.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/enemies/green_right.png"
dest_files=["res://.godot/imported/green_right.png-d334b23992f11797db1b71df5396cdf7.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
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/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 258 KiB

After

Width:  |  Height:  |  Size: 266 KiB

Before After
Before After

Binary file not shown.

After

Width:  |  Height:  |  Size: 266 KiB

View file

Before

Width:  |  Height:  |  Size: 2 KiB

After

Width:  |  Height:  |  Size: 2 KiB

Before After
Before After

View file

@ -3,15 +3,15 @@
importer="texture" importer="texture"
type="CompressedTexture2D" type="CompressedTexture2D"
uid="uid://br8dx2f3mfxcd" uid="uid://br8dx2f3mfxcd"
path="res://.godot/imported/bomba.png-87deebc2c1729b43b14df27006f803ea.ctex" path="res://.godot/imported/grenade.png-bd322feb79bdda47435178e6d70fca8e.ctex"
metadata={ metadata={
"vram_texture": false "vram_texture": false
} }
[deps] [deps]
source_file="res://assets/masks/bomba.png" source_file="res://assets/masks/grenade.png"
dest_files=["res://.godot/imported/bomba.png-87deebc2c1729b43b14df27006f803ea.ctex"] dest_files=["res://.godot/imported/grenade.png-bd322feb79bdda47435178e6d70fca8e.ctex"]
[params] [params]

1
green_enemy.gd Normal file
View file

@ -0,0 +1 @@
extends Enemy

1
green_enemy.gd.uid Normal file
View file

@ -0,0 +1 @@
uid://bsd253gjums2r

14
resources/grenade.tres Normal file
View file

@ -0,0 +1,14 @@
[gd_resource type="Resource" script_class="MaskData" format=3 uid="uid://cmcdkylu5hog2"]
[ext_resource type="PackedScene" uid="uid://b6n1ogixc2chy" path="res://scenes/grenade.tscn" id="1_kmcar"]
[ext_resource type="Script" uid="uid://c37qcqntd6ofm" path="res://scripts/mask_data.gd" id="1_vy56m"]
[ext_resource type="Texture2D" uid="uid://kw0b4c52lx2" path="res://assets/masks/maske_spit_drop.png" id="2_g83rr"]
[ext_resource type="Texture2D" uid="uid://b8c2tfimwhf8k" path="res://assets/masks/maske_spit.png" id="4_ebseb"]
[resource]
script = ExtResource("1_vy56m")
mask_name = "Granade"
texture = ExtResource("4_ebseb")
drop_texture = ExtResource("2_g83rr")
attack_scene = ExtResource("1_kmcar")
metadata/_custom_type_script = "uid://c37qcqntd6ofm"

View file

@ -33,7 +33,7 @@ attack_charge_time = 0.1
flee_range = 0.0 flee_range = 0.0
approach_range = 60.0 approach_range = 60.0
current_mask_data = ExtResource("2_j1ss0") current_mask_data = ExtResource("2_j1ss0")
move_speed = 80.0 move_speed = 60.0
main_visual = NodePath("Anim") main_visual = NodePath("Anim")
death_scene = ExtResource("3_esqeu") death_scene = ExtResource("3_esqeu")

37
scenes/env_particles.tscn Normal file
View file

@ -0,0 +1,37 @@
[gd_scene format=3 uid="uid://bfuksmq20k8sa"]
[ext_resource type="Texture2D" uid="uid://dd1us1nw7uqkh" path="res://assets/vfx/leafs.png" id="1_b522c"]
[ext_resource type="Script" uid="uid://cakh44cbphr4s" path="res://scripts/screen_particles.gd" id="2_elx8x"]
[sub_resource type="AtlasTexture" id="AtlasTexture_fma68"]
atlas = ExtResource("1_b522c")
region = Rect2(0, 0, 8, 8)
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_h77w7"]
particle_flag_disable_z = true
emission_shape = 3
emission_box_extents = Vector3(1000, 16.01, 0)
angle_min = -279.5
angle_max = 313.40002
direction = Vector3(0, 1, 0)
spread = 15.0
initial_velocity_min = 61.85
initial_velocity_max = 247.43
angular_velocity_min = -177.88
angular_velocity_max = 177.87997
gravity = Vector3(-200, 300, 0)
turbulence_enabled = true
turbulence_noise_strength = 0.1
turbulence_noise_scale = 4.253
turbulence_noise_speed_random = 0.32
[node name="EnvParticles" type="GPUParticles2D" unique_id=786365479]
modulate = Color(0.75430965, 0.9297428, 1.0795158, 1)
amount = 512
texture = SubResource("AtlasTexture_fma68")
lifetime = 20.0
preprocess = 3.0
fixed_fps = 0
draw_order = 0
process_material = SubResource("ParticleProcessMaterial_h77w7")
script = ExtResource("2_elx8x")

47
scenes/green_enemy.tscn Normal file
View file

@ -0,0 +1,47 @@
[gd_scene format=3 uid="uid://gocrwmgwlk4l"]
[ext_resource type="Script" uid="uid://bsd253gjums2r" path="res://green_enemy.gd" id="1_nuwt0"]
[ext_resource type="Resource" uid="uid://cmcdkylu5hog2" path="res://resources/grenade.tres" id="2_go8sg"]
[ext_resource type="Texture2D" uid="uid://bbmtfih341ity" path="res://assets/enemies/green_(plum)-1.png" id="3_c4k54"]
[ext_resource type="Texture2D" uid="uid://binu4ig8dwobe" path="res://assets/enemies/green_(plum)-2.png" id="4_s3gbq"]
[ext_resource type="Texture2D" uid="uid://c2dgywtcsuicp" path="res://assets/enemies/green_(plum)-3.png" id="5_io1dp"]
[ext_resource type="Texture2D" uid="uid://bpf15ye4rok7r" path="res://assets/enemies/green_(plum)-4.png" id="6_0v5hx"]
[sub_resource type="SpriteFrames" id="SpriteFrames_qegda"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": ExtResource("3_c4k54")
}, {
"duration": 1.0,
"texture": ExtResource("4_s3gbq")
}, {
"duration": 1.0,
"texture": ExtResource("5_io1dp")
}, {
"duration": 1.0,
"texture": ExtResource("6_0v5hx")
}],
"loop": true,
"name": &"default",
"speed": 5.0
}]
[sub_resource type="CircleShape2D" id="CircleShape2D_nuwt0"]
radius = 15.0
[node name="GreenEnemy" type="CharacterBody2D" unique_id=2025157106 node_paths=PackedStringArray("main_visual")]
script = ExtResource("1_nuwt0")
flee_range = 100.0
approach_range = 200.0
current_mask_data = ExtResource("2_go8sg")
main_visual = NodePath("AnimatedSprite2D")
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="." unique_id=876664215]
sprite_frames = SubResource("SpriteFrames_qegda")
frame = 3
frame_progress = 0.72517973
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=1259136395]
position = Vector2(0, 10)
shape = SubResource("CircleShape2D_nuwt0")

View file

@ -0,0 +1,30 @@
[gd_scene format=3 uid="uid://dqu37r80dlxao"]
[ext_resource type="Texture2D" uid="uid://d1ybbm5tk1tbd" path="res://assets/vfx/particle_star.png" id="1_rocpj"]
[sub_resource type="Curve" id="Curve_mb78c"]
_data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(1, 1), 0.0, 0.0, 0, 0]
point_count = 2
[sub_resource type="Gradient" id="Gradient_68us8"]
offsets = PackedFloat32Array(0, 0.61440676, 1)
colors = PackedColorArray(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0)
[node name="GreenExplosion" type="CPUParticles2D" unique_id=490180742]
emitting = false
amount = 120
texture = ExtResource("1_rocpj")
one_shot = true
explosiveness = 1.0
spread = 180.0
gravity = Vector2(0, -100)
initial_velocity_max = 86.95
damping_min = 100.0
damping_max = 100.0
damping_curve = SubResource("Curve_mb78c")
angle_min = -386.1
angle_max = 427.8
scale_amount_min = 2.0
scale_amount_max = 4.0
color = Color(0.6155507, 1, 0.45411357, 1)
color_ramp = SubResource("Gradient_68us8")

26
scenes/grenade.tscn Normal file
View file

@ -0,0 +1,26 @@
[gd_scene format=3 uid="uid://b6n1ogixc2chy"]
[ext_resource type="Script" uid="uid://6ep27l6iw1hi" path="res://scripts/grenade.gd" id="1_wxtds"]
[ext_resource type="PackedScene" uid="uid://dqu37r80dlxao" path="res://scenes/green_explosion.tscn" id="2_76ndk"]
[ext_resource type="Texture2D" uid="uid://br8dx2f3mfxcd" path="res://assets/masks/grenade.png" id="2_vhiwl"]
[ext_resource type="Script" uid="uid://ejd25ul4j5pp" path="res://scripts/hitbox.gd" id="3_vhiwl"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_76ndk"]
[node name="Grenade" type="Node2D" unique_id=2087865404]
script = ExtResource("1_wxtds")
max_bounces = 3
explosion = ExtResource("2_76ndk")
[node name="Sprite2D" type="Sprite2D" parent="." unique_id=1335147270]
texture = ExtResource("2_vhiwl")
[node name="Hitbox" type="Area2D" parent="." unique_id=973042172]
script = ExtResource("3_vhiwl")
deal_damage = false
metadata/_custom_type_script = "uid://ejd25ul4j5pp"
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox" unique_id=574492836]
shape = SubResource("RectangleShape2D_76ndk")
[connection signal="hit_entity" from="Hitbox" to="." method="_on_hitbox_hit_entity"]

View file

@ -1,7 +1,7 @@
[gd_scene format=3 uid="uid://ncgwx0yjn2gt"] [gd_scene format=3 uid="uid://ncgwx0yjn2gt"]
[ext_resource type="Script" uid="uid://sbseykg05177" path="res://scripts/player.gd" id="1_ur7pv"] [ext_resource type="Script" uid="uid://sbseykg05177" path="res://scripts/player.gd" id="1_ur7pv"]
[ext_resource type="Resource" uid="uid://0mtm64s4jthn" path="res://resources/stars.tres" id="2_3v2ag"] [ext_resource type="Resource" uid="uid://cmcdkylu5hog2" path="res://resources/grenade.tres" id="2_3v2ag"]
[ext_resource type="PackedScene" uid="uid://bp45yth1y3ia5" path="res://scenes/player_explosion.tscn" id="3_3v2ag"] [ext_resource type="PackedScene" uid="uid://bp45yth1y3ia5" path="res://scenes/player_explosion.tscn" id="3_3v2ag"]
[ext_resource type="Script" uid="uid://synocbtvgrf4" path="res://scripts/shadow.gd" id="4_3v2ag"] [ext_resource type="Script" uid="uid://synocbtvgrf4" path="res://scripts/shadow.gd" id="4_3v2ag"]
[ext_resource type="Texture2D" uid="uid://d3abeekjumqyb" path="res://assets/player/maske1.png" id="5_jej6c"] [ext_resource type="Texture2D" uid="uid://d3abeekjumqyb" path="res://assets/player/maske1.png" id="5_jej6c"]

43
scenes/portal.tscn Normal file
View file

@ -0,0 +1,43 @@
[gd_scene format=3 uid="uid://u72uxgovmbhd"]
[ext_resource type="Shader" uid="uid://bnnclls153x2j" path="res://shaders/selective_glow.gdshader" id="1_ckw30"]
[ext_resource type="Texture2D" uid="uid://db3a6q3o787qh" path="res://assets/enviroment/portal.png" id="2_4pvrx"]
[ext_resource type="Script" uid="uid://cioob0euvug4e" path="res://scripts/portal.gd" id="3_i0ytf"]
[ext_resource type="Script" uid="uid://pyblew2m6xc3" path="res://scripts/magic_circle.gd" id="4_frqps"]
[ext_resource type="Script" uid="uid://c0wn3w7q2j470" path="res://scripts/proximity.gd" id="5_5yude"]
[ext_resource type="Theme" uid="uid://d3iyu7ukwsn1p" path="res://ui/default_theme.tres" id="6_e5sgc"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_xfvwf"]
shader = ExtResource("1_ckw30")
shader_parameter/replace = Color(0.49803922, 0.5529412, 0.9490196, 1)
shader_parameter/intensity = 0.0
[node name="Portal" type="Sprite2D" unique_id=1512558284]
material = SubResource("ShaderMaterial_xfvwf")
texture = ExtResource("2_4pvrx")
script = ExtResource("3_i0ytf")
[node name="MagicCircle" type="Node2D" parent="." unique_id=235520935]
position = Vector2(3, 7)
scale = Vector2(1, 0.5)
script = ExtResource("4_frqps")
base_rad = 3.135
layer_rad_inc = 1.925
layers = 9
main_color = Color(0.7254902, 0.8352941, 1, 1)
fixed_seed = 1231
squish = 0.5
line_width = 1.0
metadata/_custom_type_script = "uid://pyblew2m6xc3"
[node name="Text" type="Node2D" parent="." unique_id=821025739]
script = ExtResource("5_5yude")
show_range = 100
[node name="Label" type="Label" parent="Text" unique_id=773740984]
offset_left = -57.0
offset_top = -52.0
offset_right = 104.0
offset_bottom = -29.0
theme = ExtResource("6_e5sgc")
text = "Press E to continue..."

View file

@ -1,7 +1,7 @@
[gd_scene load_steps=4 format=3 uid="uid://dfad6rsacpogt"] [gd_scene format=3 uid="uid://dfad6rsacpogt"]
[ext_resource type="Script" uid="uid://ctninfm8hkbp2" path="res://scripts/spit.gd" id="1_1fhrs"] [ext_resource type="Script" uid="uid://ctninfm8hkbp2" path="res://scripts/spit.gd" id="1_1fhrs"]
[ext_resource type="Texture2D" uid="uid://br8dx2f3mfxcd" path="res://assets/masks/bomba.png" id="2_1fhrs"] [ext_resource type="Texture2D" uid="uid://br8dx2f3mfxcd" path="res://assets/masks/grenade.png" id="2_1fhrs"]
[ext_resource type="PackedScene" uid="uid://bbqgdjgil7nwx" path="res://scenes/spit_payload.tscn" id="4_03rlv"] [ext_resource type="PackedScene" uid="uid://bbqgdjgil7nwx" path="res://scenes/spit_payload.tscn" id="4_03rlv"]
[node name="Spit" type="Node2D"] [node name="Spit" type="Node2D"]

File diff suppressed because one or more lines are too long

View file

@ -34,4 +34,5 @@ metadata/_custom_type_script = "uid://ejd25ul4j5pp"
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox" unique_id=263019627] [node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox" unique_id=263019627]
shape = SubResource("CircleShape2D_8lrp4") shape = SubResource("CircleShape2D_8lrp4")
[connection signal="collided" from="Hitbox" to="." method="_on_hitbox_collided"] [connection signal="hit_entity" from="Hitbox" to="." method="_on_hitbox_hit_entity"]
[connection signal="hit_obstacle" from="Hitbox" to="." method="_on_hitbox_hit_obstacle"]

File diff suppressed because one or more lines are too long

View file

@ -4,8 +4,7 @@ class_name Enemy extends Entity
@export var flee_range: float = 20.0 @export var flee_range: float = 20.0
@export var approach_range: float = 100.0 @export var approach_range: float = 100.0
@onready var nav_agent: NavigationAgent2D = $NavigationAgent2D @onready var nav_agent: NavigationAgent2D;
@onready var sprite = $Anim
var current_charge: float = 0.0 var current_charge: float = 0.0
var target_node: Node2D var target_node: Node2D
@ -13,6 +12,8 @@ var target_node: Node2D
func _ready() -> void: func _ready() -> void:
add_to_group("enemy") add_to_group("enemy")
target_node = get_tree().get_first_node_in_group("player") target_node = get_tree().get_first_node_in_group("player")
nav_agent = NavigationAgent2D.new()
add_child(nav_agent)
func _physics_process(delta: float) -> void: func _physics_process(delta: float) -> void:
if not target_node: return if not target_node: return
@ -31,7 +32,7 @@ func _physics_process(delta: float) -> void:
else: else:
_handle_attack_charge(delta) _handle_attack_charge(delta)
sprite.flip_h = target_node.position.x > position.x main_visual.flip_h = target_node.position.x > position.x
scale = Vector2.ONE * (1 + (current_charge * 0.2)) scale = Vector2.ONE * (1 + (current_charge * 0.2))
super._physics_process(delta) super._physics_process(delta)

68
scripts/grenade.gd Normal file
View file

@ -0,0 +1,68 @@
extends MaskAbility
@export var max_bounces := 5
@export var speed := 1.4
@export var max_height = 100.
@export var explosion : PackedScene
@onready var sprite : Sprite2D = $Sprite2D
var traveled: float = 0.0
var bouncing = false
var target : Enemy = null
var bounces := max_bounces
var already_hit : Array[Enemy] = []
func mask_ready():
super.mask_ready()
func _physics_process(delta: float) -> void:
if traveled < 1:
if target:
target_position = target.position
traveled += speed * delta
global_position = start_position.lerp(target_position, traveled)
var arc_y = 4 * max_height * traveled * (1 - traveled)
sprite.position.y = -arc_y
elif bouncing and bounces > 0:
if target:
target.damage()
change_target()
else:
global_position = target_position
sprite.position.y = 0
func change_target():
var enemies = get_tree().get_nodes_in_group("enemy")
var dist := 100000.
var closest : Entity = null
for e : Enemy in enemies:
if e in already_hit: continue
var e_dist = e.global_position.distance_to(global_position)
if e_dist < dist:
dist = e_dist
closest = e
bounces -= 1
target = null
if dist < 60:
target = closest
already_hit.append(closest)
start_position = global_position
target_position = closest.global_position
traveled = 0
var explo = explosion.instantiate()
explo.emitting = true
add_child(explo)
func _on_hitbox_hit_entity(entity : Entity) -> void:
if from_player:
for c in _get_all_children(self):
if c is Hitbox:
c.enabled = false
bouncing = true
target = entity
already_hit = [entity]
#change_target()

1
scripts/grenade.gd.uid Normal file
View file

@ -0,0 +1 @@
uid://6ep27l6iw1hi

View file

@ -1,30 +1,35 @@
class_name Hitbox extends Area2D class_name Hitbox extends Area2D
signal collided; signal hit_entity(entity : Entity);
signal hit_obstacle;
var from_player = true var from_player = true
var enabled = true var enabled = true
@export var deal_damage = true
func _ready() -> void: func _ready() -> void:
collision_mask = 0xffff collision_mask = 1 | 2 | 4
body_entered.connect(_on_body_entered) body_entered.connect(_on_body_entered)
area_entered.connect(_on_area_entered) area_entered.connect(_on_area_entered)
func _on_area_entered(area : Area2D): func _on_area_entered(area : Area2D):
if area is Hitbox: if area is Hitbox:
if area.from_player != from_player: if area.from_player != from_player:
collided.emit() hit_obstacle.emit()
func _on_body_entered(body: Node) -> void: func _on_body_entered(body: Node) -> void:
print(body)
if not enabled: return if not enabled: return
if body is Enemy and from_player: if body is Enemy and from_player:
body.damage() if deal_damage:
collided.emit() body.damage()
body.knockback() body.knockback()
hit_entity.emit(body)
if body is Player and not from_player: if body is Player and not from_player:
body.damage() if deal_damage:
collided.emit() body.damage()
if body is StaticBody2D or body is Hitbox: hit_entity.emit(body)
collided.emit()
if body is StaticBody2D:
hit_obstacle.emit()

View file

@ -8,5 +8,5 @@ func spawn():
get_tree().current_scene.add_child(entity) get_tree().current_scene.add_child(entity)
entity.global_position = global_position entity.global_position = global_position
entity.scale.y = 5 entity.scale.y = 5
#create_tween().tween_property(entity, "scale:y", 1, 0.2) create_tween().tween_property(entity, "scale:y", 1, 0.2)
entity.died.connect(finished.emit) entity.died.connect(finished.emit)

View file

@ -17,5 +17,8 @@ func _physics_process(delta: float) -> void:
rotation += rot_speed * delta rotation += rot_speed * delta
position += dir * speed * delta position += dir * speed * delta
func _on_hitbox_collided() -> void: func _on_hitbox_hit_obstacle() -> void:
queue_free()
func _on_hitbox_hit_entity(entity: Entity) -> void:
queue_free() queue_free()

View file

@ -3,14 +3,18 @@ class_name WaveNode extends Node2D
@export var spawn_interval := 0.2 @export var spawn_interval := 0.2
signal finished; signal finished;
var entities := 0; var entities := 0;
var started_wave = false
func _ready() -> void: func _ready() -> void:
entities = get_child_count() entities = get_child_count()
func spawn_wave(): func spawn_wave():
if started_wave: return
started_wave = true
if get_child_count() == 0: if get_child_count() == 0:
finished.emit() finished.emit()
return; return
for c : Spawner in get_children(): for c : Spawner in get_children():
c.spawn(); c.spawn();

View file

@ -1,21 +1,6 @@
- Enemy room spawn logic - Green enemy jhin attack
- On enter room, spawn enemies in waves
- New enemies:
- Charge towards you
- Laser target
- Summon
- Player upgrades?
- Change dash, blink, attack speed, speed, hp, regen, idk?
- Mask upgrades?
- Scythe more rotations, bigger size, lower cooldown, on-ht heal, chain hit
- Invul on hit, shield on hit, soul reaps, better dash, double hit, projectile wave
- leave ground chare, mark enemies
- stuns
- Ranged more speed, more projectiles, on-hit explosion, more damage range,
- Settings screenshake - Settings screenshake
- Sfx soon - Sfx soon
- Player only invul - Player only invul
- QOL: modualte only entity spriet on damage, abilites fadeout time
- MaskAbility class
- BossFight 1:
- Melee attacks, tp?, dash, scythe spawning

View file

@ -34,6 +34,7 @@ HSlider/icons/grabber_highlight = ExtResource("2_i4llc")
HSlider/styles/grabber_area = SubResource("StyleBoxFlat_i4llc") HSlider/styles/grabber_area = SubResource("StyleBoxFlat_i4llc")
HSlider/styles/grabber_area_highlight = SubResource("StyleBoxFlat_5r0yv") HSlider/styles/grabber_area_highlight = SubResource("StyleBoxFlat_5r0yv")
HSlider/styles/slider = SubResource("StyleBoxFlat_0ie0l") HSlider/styles/slider = SubResource("StyleBoxFlat_0ie0l")
Label/constants/line_spacing = 2
Label/font_sizes/font_size = 16 Label/font_sizes/font_size = 16
Label/fonts/font = ExtResource("1_vos2p") Label/fonts/font = ExtResource("1_vos2p")
MarginContainer/constants/margin_bottom = 12 MarginContainer/constants/margin_bottom = 12