Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added assets/acid_slug/dead.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions assets/acid_slug/dead.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://kukhycmvn8jm"
path="res://.godot/imported/dead.png-6582490a0f80038448f4a2fb17399760.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://assets/acid_slug/dead.png"
dest_files=["res://.godot/imported/dead.png-6582490a0f80038448f4a2fb17399760.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
Binary file added assets/acid_slug/dead.xcf
Binary file not shown.
Binary file added assets/lava_ant/dead.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions assets/lava_ant/dead.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://dwx70ehs7yhd5"
path="res://.godot/imported/dead.png-40bdc3501c81304eba7f83b0de69eff2.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://assets/lava_ant/dead.png"
dest_files=["res://.godot/imported/dead.png-40bdc3501c81304eba7f83b0de69eff2.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
Binary file added assets/lava_ant/dead.xcf
Binary file not shown.
1 change: 1 addition & 0 deletions scenes/enemies/acid_slug.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ animations = [{
script = ExtResource("2_0y44s")
idle_speed = 75
pursuit_speed = 100
enemy_name = "acid slug"
health = 15

[node name="AnimatedSprite2D" parent="." index="2"]
Expand Down
9 changes: 9 additions & 0 deletions scenes/enemies/acid_slug_corpse.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[gd_scene load_steps=2 format=3 uid="uid://8adnlirnllrd"]

[ext_resource type="Texture2D" uid="uid://kukhycmvn8jm" path="res://assets/acid_slug/dead.png" id="1_64ysi"]

[node name="AcidSlugCorpse" type="Node2D"]

[node name="Sprite2D" type="Sprite2D" parent="."]
z_index = 5
texture = ExtResource("1_64ysi")
4 changes: 3 additions & 1 deletion scenes/enemies/enemy.gd
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class_name Enemy

@export var idle_speed: int = 150
@export var pursuit_speed: int = 300
@export var enemy_name: String = "enemy"
var collision_tilemap: TileMapLayer
var speed: int = 0
var vulnerable: bool = true
Expand Down Expand Up @@ -38,7 +39,7 @@ func _ready() -> void:
# scaling
#scale = Vector2(scaling, scaling)
animated_sprite_2d.scale = Vector2(scaling, scaling)
$AttackArea2D.scale = Vector2(scaling, scaling) * 1.25
$AttackArea2D.scale *= Vector2(scaling, scaling)
idle_speed += ((1 - scaling) * 1.5) * idle_speed
pursuit_speed += ((1 - scaling) * 1.5) * pursuit_speed
if scaling > 0.75:
Expand Down Expand Up @@ -122,6 +123,7 @@ func switch_state(state_enum) -> void:
state = DEAD
speed = 0
navigating = false
Globals.signal_enemy_died(enemy_name, position, scaling)
queue_free()

func _on_navigation_agent_2d_target_reached() -> void:
Expand Down
1 change: 1 addition & 0 deletions scenes/enemies/lava_ant.gd
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ func summon_lava_aoe():
func _on_animated_sprite_2d_animation_finished() -> void:
if animated_sprite_2d.animation == "explode":
summon_lava_aoe()
Globals.signal_enemy_died(enemy_name, position, scaling)
queue_free()

func switch_state(state_enum) -> void:
Expand Down
1 change: 1 addition & 0 deletions scenes/enemies/lava_ant.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ z_index = 5
collision_layer = 2
collision_mask = 12
script = ExtResource("1_1ih35")
enemy_name = "lava ant"

[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("CircleShape2D_ey3sv")
Expand Down
9 changes: 9 additions & 0 deletions scenes/enemies/lava_ant_corpse.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[gd_scene load_steps=2 format=3 uid="uid://dl7j6lw28a6qo"]

[ext_resource type="Texture2D" uid="uid://dwx70ehs7yhd5" path="res://assets/lava_ant/dead.png" id="1_pdcod"]

[node name="LavaAntCorpse" type="Node2D"]
z_index = 5

[node name="Sprite2D" type="Sprite2D" parent="."]
texture = ExtResource("1_pdcod")
4 changes: 4 additions & 0 deletions scenes/globals.gd
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ signal collected (type)
signal acid_aoe (position, scaling)
signal lava_aoe (position, scaling)
signal ice_aoe (position, scaling)
signal enemy_died (type, scaling)


var player_pos: Vector2
Expand Down Expand Up @@ -36,3 +37,6 @@ func place_lava_aoe(position: Vector2, scaling: float) -> void:

func place_ice_aoe(position: Vector2, scaling: float) -> void:
ice_aoe.emit(position, scaling)

func signal_enemy_died(type: String, position: Vector2, scaling: float) -> void:
enemy_died.emit(type, position, scaling)
17 changes: 17 additions & 0 deletions scenes/levels/level.gd
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ var hero: Hero
var _change_scene:bool = false

func _ready() -> void:
Globals.enemy_died.connect(_on_enemy_died)
Input.set_custom_mouse_cursor(TARGET_ROUND_B, 0, Vector2(30, 30))
for enemy in $Enemies.get_children():
if enemy is Splitting:
Expand Down Expand Up @@ -237,3 +238,19 @@ func trigger_spawners():
enemy.connect("lava_aoe", _on_lava_ant_lava_aoe)
$Enemies.add_child(enemy)
num_enemies_spawned += 1

func _on_enemy_died(type: String, pos: Vector2, scaling: float) -> void:
print(type)
match type:
"lava ant":
const LAVA_ANT_CORPSE = preload("res://scenes/enemies/lava_ant_corpse.tscn")
var corpse = LAVA_ANT_CORPSE.instantiate()
corpse.scale *= scaling
corpse.position = pos
add_child(corpse)
"acid slug":
const ACID_SLUG_CORPSE = preload("res://scenes/enemies/acid_slug_corpse.tscn")
var corpse = ACID_SLUG_CORPSE.instantiate()
corpse.scale *= scaling
corpse.position = pos
add_child(corpse)
2 changes: 1 addition & 1 deletion shaders/flash_shader_material.tres
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
[resource]
resource_local_to_scene = true
shader = ExtResource("1_1quyw")
shader_parameter/active = false
shader_parameter/active = true
shader_parameter/color = Color(1, 1, 1, 1)