added the scrump
This commit is contained in:
parent
e5151c4a28
commit
5d7a5a1d29
9 changed files with 70 additions and 58 deletions
|
@ -6,9 +6,11 @@ var hp = 3
|
|||
var arrow_speed = 80
|
||||
export var phase2_speed = 100
|
||||
export var phase3_speed = 150
|
||||
const ArrowProjectile = preload("res://objects/player/arrow_projectile.tscn")
|
||||
const projectile = preload("res://objects/enemy/boss/boss1_projectile.tscn")
|
||||
const arrow_pickup = preload("res://objects/collectibles/arrow.tscn")
|
||||
onready var shoot_timer = $ShootTimer
|
||||
onready var shootpoint = $Position2D
|
||||
onready var map = get_owner()
|
||||
var shoot_time = Vector2(0.4,0.7)
|
||||
export var arrow_spawns = [Vector2(0,0),Vector2(0,0),Vector2(0,0)]
|
||||
|
||||
|
@ -16,16 +18,7 @@ func _ready():
|
|||
seed(hash("HEROMARK2"))
|
||||
|
||||
func shoot():
|
||||
var arrow = ArrowProjectile.instance()
|
||||
arrow.global_position = Vector2(
|
||||
global_position.x + $Position2D.position.x,
|
||||
stepify(global_position.y + $Position2D.position.y,8)
|
||||
)
|
||||
arrow.direction = -1
|
||||
arrow.breaks_on_wall = false
|
||||
arrow.target_group = "player"
|
||||
arrow.speed = arrow_speed
|
||||
get_owner().add_child(arrow)
|
||||
Game.instance_node(projectile,global_position.x + shootpoint.position.x,stepify(global_position.y + shootpoint.position.y,8),map)
|
||||
|
||||
func _on_ShootTimer_timeout():
|
||||
shoot_timer.start(rand_range(shoot_time.x,shoot_time.y))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue