Working with Jennie to adjust enemy identification in bullet.gd script

This commit is contained in:
Henry 2026-02-28 19:12:16 +00:00
parent 448009b6e4
commit aae3238906
3 changed files with 47 additions and 31 deletions

View file

@ -21,8 +21,8 @@ func _on_area_entered(area: Area2D) -> void:
var enemies = get_tree().get_nodes_in_group("enemies") var enemies = get_tree().get_nodes_in_group("enemies")
for enemy in enemies: #for enemy in enemies:
match enemy.enemy_type: match enemies.enemy_type:
"crt": "crt":
if area.is_in_group("enemies"): if area.is_in_group("enemies"):
print("CRT hit!") print("CRT hit!")
@ -35,15 +35,12 @@ func _on_area_entered(area: Area2D) -> void:
print("Shards hit!") print("Shards hit!")
area.hit_detection() area.hit_detection()
"mirror": "mirror":
if area.is_in_group("enemies"): if area.is_in_group("enemies"):
print("Mirror hit!") print("Mirror hit!")
area.hit_detection() area.hit_detection()
queue_free() queue_free()
"chicken": "chicken":
if area.is_in_group("enemies"): if area.is_in_group("enemies"):
print("Chicken hit!") print("Chicken hit!")

View file

@ -2,13 +2,32 @@
[ext_resource type="Script" uid="uid://7ls7phfcupal" path="res://scenes/enemy_crt.gd" id="1_ugdur"] [ext_resource type="Script" uid="uid://7ls7phfcupal" path="res://scenes/enemy_crt.gd" id="1_ugdur"]
[ext_resource type="Texture2D" uid="uid://b5pswf7r8b7j4" path="res://sprites/crt.png" id="2_emiuq"] [ext_resource type="Texture2D" uid="uid://b5pswf7r8b7j4" path="res://sprites/crt.png" id="2_emiuq"]
[ext_resource type="Shader" uid="uid://dfywtah53il1m" path="res://shaders/player_hit.gdshader" id="2_gas3w"]
[ext_resource type="Texture2D" uid="uid://cy4jggxmnohbb" path="res://sprites/chicken.png" id="2_ugdur"] [ext_resource type="Texture2D" uid="uid://cy4jggxmnohbb" path="res://sprites/chicken.png" id="2_ugdur"]
[ext_resource type="Texture2D" uid="uid://bm7fgqwqfqmf4" path="res://sprites/explosion_pallete-swap.png" id="3_emiuq"] [ext_resource type="Texture2D" uid="uid://bm7fgqwqfqmf4" path="res://sprites/explosion_pallete-swap.png" id="3_emiuq"]
[ext_resource type="AudioStream" uid="uid://cbi5q575w1g1n" path="res://sounds/CRT_IMPACT.wav" id="6_gas3w"] [ext_resource type="AudioStream" uid="uid://cbi5q575w1g1n" path="res://sounds/CRT_IMPACT.wav" id="6_gas3w"]
[sub_resource type="Shader" id="Shader_emiuq"]
code = "shader_type canvas_item;
uniform float toggle;
void vertex() {
// Called for every vertex the material is visible on.
}
void fragment() {
COLOR = texture(TEXTURE, UV);
COLOR.r = mix(COLOR.r, abs(sin(TIME * 20.25)), toggle);
}
//void light() {
// // Called for every pixel for every light affecting the CanvasItem.
// // Uncomment to replace the default light processing function with this one.
//}
"
[sub_resource type="ShaderMaterial" id="ShaderMaterial_gas3w"] [sub_resource type="ShaderMaterial" id="ShaderMaterial_gas3w"]
shader = ExtResource("2_gas3w") shader = SubResource("Shader_emiuq")
shader_parameter/toggle = 0.0 shader_parameter/toggle = 0.0
[sub_resource type="RectangleShape2D" id="RectangleShape2D_4gyqm"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_4gyqm"]

View file

@ -24,7 +24,7 @@ func _ready():
func spawn_enemies(): func spawn_enemies():
if wave_count == 2: #This is for CHICKENS if wave_count == 0: #This is for CHICKENS
print("Enemy Wave: ", wave_count) print("Enemy Wave: ", wave_count)
enemy = CHICKEN enemy = CHICKEN
for x in range(COLS): for x in range(COLS):
@ -37,7 +37,7 @@ func spawn_enemies():
await get_tree().process_frame await get_tree().process_frame
print_debug("Remaining enemies: ", enemy_count, ", ", get_tree().get_nodes_in_group("enemies").size()) print_debug("Remaining enemies: ", enemy_count, ", ", get_tree().get_nodes_in_group("enemies").size())
if wave_count == 0: #This is for CRTs if wave_count == 1: #This is for CRTs
print("Enemy Wave: ", wave_count) print("Enemy Wave: ", wave_count)
enemy = CRT enemy = CRT
var cols_mod = COLS - 1 var cols_mod = COLS - 1
@ -52,7 +52,7 @@ func spawn_enemies():
enemy_count = rows_mod * cols_mod enemy_count = rows_mod * cols_mod
await get_tree().process_frame await get_tree().process_frame
if wave_count == 1: #This if for Mirror if wave_count == 2: #This if for Mirror
print("Enemy Wave: ", wave_count) print("Enemy Wave: ", wave_count)
# Spawn Table # Spawn Table