added blocking doors to paths.
This commit is contained in:
@@ -27,11 +27,15 @@ func _ready():
|
||||
|
||||
max_health = 20.0
|
||||
current_health = max_health
|
||||
move_speed = 35.0 # Slow normally (reduced from 60)
|
||||
move_speed = 20.0 # Very slow (reduced from 35)
|
||||
damage = 6.0
|
||||
|
||||
state_timer = idle_duration
|
||||
|
||||
# CRITICAL: Ensure collision mask is set correctly after super._ready()
|
||||
# Walls are on layer 7 (bit 6 = 64), objects on layer 2, players on layer 1
|
||||
collision_mask = 1 | 2 | 64 # Collide with players (layer 1), objects (layer 2), and walls (layer 7 = bit 6 = 64)
|
||||
|
||||
# Slime is small - adjust collision
|
||||
if collision_shape and collision_shape.shape:
|
||||
collision_shape.shape.radius = 6.0 # 12x12 effective size
|
||||
@@ -120,11 +124,11 @@ func _start_jump():
|
||||
# Jump towards player if nearby
|
||||
if target_player and is_instance_valid(target_player):
|
||||
var direction = (target_player.global_position - global_position).normalized()
|
||||
velocity = direction * (move_speed * 1.8) # Faster during jump
|
||||
velocity = direction * (move_speed * 1.4) # Slightly faster during jump (reduced from 1.8)
|
||||
else:
|
||||
# Random jump direction
|
||||
var random_dir = Vector2(randf() - 0.5, randf() - 0.5).normalized()
|
||||
velocity = random_dir * (move_speed * 1.8)
|
||||
velocity = random_dir * (move_speed * 1.4) # Slightly faster during jump (reduced from 1.8)
|
||||
|
||||
func _jumping_behavior(_delta):
|
||||
# Continue moving in jump direction
|
||||
|
||||
Reference in New Issue
Block a user