startTime = Time.time --records when the wave started
endTime = 5 --when the attack ends
function Update()
local t = Time.time - startTime
if (t < endTime) then
chasingbullet = CreateProjectile('bullet', Arena.width/2, Arena.height/2)
chasingbullet.SetVar('xspeed', 0)
chasingbullet.SetVar('yspeed', 0)
function Update()
local xdifference = Player.x - chasingbullet.x
local ydifference = Player.y - chasingbullet.y
local xspeed = chasingbullet.GetVar('xspeed') / 2 + xdifference / 100
local yspeed = chasingbullet.GetVar('yspeed') / 2 + ydifference / 100
chasingbullet.Move(xspeed, yspeed)
chasingbullet.SetVar('xspeed', xspeed)
chasingbullet.SetVar('yspeed', yspeed)
end
else
SetGlobal('phase', 1)
State("ENEMYDIALOGUE")
end
end