forked from team-sg/hero-mark-2
scrump projectile disapear on collision and better disappear graphics (closes #190)
This commit is contained in:
parent
f3d5446d66
commit
1e472333a5
2 changed files with 28 additions and 12 deletions
|
@ -1,10 +1,26 @@
|
|||
extends "res://objects/enemy/enemy.gd"
|
||||
|
||||
|
||||
func _physics_process(delta):
|
||||
position.x -= 80 * delta
|
||||
var speed: float = 80.0
|
||||
|
||||
func _on_Hitbox_area_entered(area):
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
position.x -= speed * delta
|
||||
|
||||
func _on_Hitbox_area_entered(area: Node) -> void:
|
||||
._on_Hitbox_area_entered(area)
|
||||
if area.is_in_group("player_hitbox"):
|
||||
self.queue_free()
|
||||
_stop()
|
||||
|
||||
|
||||
func _on_Hitbox_body_entered(body: Node) -> void:
|
||||
if body is TileMap:
|
||||
_stop()
|
||||
|
||||
|
||||
func _stop() -> void:
|
||||
speed = 0.0
|
||||
$Hitbox.queue_free()
|
||||
for child in $Particles.get_children():
|
||||
if child is CPUParticles2D:
|
||||
child.emitting = false
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue