added the game

This commit is contained in:
JHDev2006
2025-09-13 16:30:32 +01:00
parent 5ef689109b
commit 3773bdaf64
3616 changed files with 263702 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
extends Enemy
const MOVE_SPEED := 30
const BARREL_DESTRUCTION_PARTICLE = preload("res://Scenes/Prefabs/Particles/BarrelDestructionParticle.tscn")
func _physics_process(delta: float) -> void:
handle_movement(delta)
func handle_movement(delta: float) -> void:
if is_on_wall() and is_on_floor() and get_wall_normal().x == -direction:
die()
func die() -> void:
destroy()
func die_from_object(_node: Node2D) -> void:
destroy()
func summon_particle() -> void:
var node = BARREL_DESTRUCTION_PARTICLE.instantiate()
node.global_position = global_position - Vector2(0, 8)
add_sibling(node)
func destroy() -> void:
summon_particle()
AudioManager.play_sfx("block_break", global_position)
queue_free()
func bounce_up() -> void:
velocity.y = -200