Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- The chasing attack from the documentation example.
- chasingbullet = CreateProjectile('Wandering_Eye normal', Arena.width/16, Arena.height/16)
- 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 / 50
- local yspeed = chasingbullet.GetVar('yspeed') / 2 + ydifference / 50
- chasingbullet.Move(xspeed, yspeed)
- chasingbullet.SetVar('xspeed', xspeed)
- chasingbullet.SetVar('yspeed', yspeed)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement