forked from team-sg/hero-mark-2
enemies now get squashed by rocks
This commit is contained in:
parent
416982d88e
commit
2cb646ce32
14 changed files with 110 additions and 28 deletions
|
@ -27,8 +27,9 @@ func _on_Area2D_area_entered(area):
|
|||
Game.instance_node(Game.block_text,global_position.x,global_position.y,get_parent())
|
||||
#Die from rock/ get squashed
|
||||
if area.is_in_group("squash"):
|
||||
Debug.print("squash")
|
||||
var squasher = area.get_parent()
|
||||
if squasher.position.y + squasher.bottom.position.y < global_position.y:
|
||||
if squasher.global_position.y < global_position.y && squasher.velocity.y > 0:
|
||||
die()
|
||||
|
||||
func die():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue