start work on boss1
This commit is contained in:
parent
ed04bf1c2e
commit
85f3a0af08
8 changed files with 244 additions and 7 deletions
|
@ -7,6 +7,9 @@ var target_group = "enemy_hitbox"
|
|||
# direction to fly
|
||||
var direction = 1.0
|
||||
|
||||
# whether or not it frees on wall collision
|
||||
var breaks_on_wall = true
|
||||
|
||||
#Edge to check culling, if this edge is offscreen, delete the arrow
|
||||
onready var cull_edge = Vector2(5 * direction,0)
|
||||
onready var player = get_parent().get_node("Player")
|
||||
|
@ -25,9 +28,10 @@ func _physics_process(delta):
|
|||
|
||||
#Wall Collision
|
||||
func _on_Hitbox_body_entered(body):
|
||||
if body is TileMap or body is StaticBody2D:
|
||||
_make_sparks()
|
||||
queue_free()
|
||||
if breaks_on_wall:
|
||||
if body is TileMap or body is StaticBody2D:
|
||||
_make_sparks()
|
||||
queue_free()
|
||||
|
||||
# kill entity if in target group
|
||||
func _on_Hitbox_area_entered(area):
|
||||
|
@ -41,7 +45,10 @@ func _on_Hitbox_area_entered(area):
|
|||
_make_sparks()
|
||||
else:
|
||||
# kill targeted node
|
||||
target.die()
|
||||
if !area.is_in_group("boss_weakspot"):
|
||||
target.die()
|
||||
else:
|
||||
target.hp -=1
|
||||
#decrease arrows if enemy killed
|
||||
if target_group == "enemy_hitbox":
|
||||
Game.arrows = max(0, Game.arrows - 1) # clamp arrows above 0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue