Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- frame = 0
- bullets = {}
- function CreateBullet(x, y)
- local bullet = CreateProjectile("Tomas/Fireball 1", x, y)
- table.insert(bullets, bullet)
- end
- function Update()
- if frame % 30 == 0 then
- for i = 0, 4, 1
- do
- local xPos = -Arena.width / 2 + i * Arena.width / 4
- local yPos = -Arena.height / 2 - 50
- CreateBullet(xPos, yPos)
- elseif frame % 60 == 0 then
- for i = 0, 4, 1
- do
- local xPos = -Arena.width / 2 + 1 * Arena.width / 4 + 20
- local yPos = -Arena.height / 2 - 50
- CreateBullet(xPos, yPos)
- end
- end
- for i = #bullets, 1, -1
- do
- currentBullet = bullets[i]
- currentBullet.Move(0, 2)
- if currentBullet.y > 170 then
- currentBullet.Remove()
- table.remove(bullets, i)
- end
- end
- frame = frame + 1
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement