Advertisement
Upscalefanatic3

Gaster

Oct 4th, 2016
530
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.61 KB | None | 0 0
  1. -- Gaster Blasters :D
  2. speed = 1
  3. moveDirection = 1
  4. bullets = {}
  5. warningSymbols = {}
  6. fireRate = 60 -- Note: Be sure to set this to an even number
  7. bulletSpeed = 7
  8. spawntimer = 0
  9. blasterPattern = math.random(1, 2)
  10. require "Libraries/blaster"
  11. flipFlop = false
  12. if GetGlobal('blasterPattern') == 3 then
  13. blasterPattern = 3
  14. end
  15. function Update()
  16. spawntimer = spawntimer + 1
  17. if blasterPattern < 3 then
  18. if spawntimer >= fireRate and spawntimer < fireRate*2 then
  19. CreateBlasters(blasterPattern, "gasterBlaster")
  20. elseif spawntimer >= fireRate*2 then
  21. FireBlasters(blasterPattern, "blast", "blastY", {"gasterBlasterFire1", "gasterBlasterFire2", "gasterBlasterFire3"}, 0.1, {"blast1", "blast2", "blast3"}, 0.07, {"blastY1", "blastY2", "blastY3"}, 0.07)
  22. end
  23. else
  24. if (spawntimer % 30 == 0) then
  25. if flipFlop == false then
  26. flipFlop = true
  27. else
  28. flipFlop = false
  29. end
  30. end
  31. if spawntimer >= 30 and spawntimer < 60 then
  32. CreateBlasters(blasterPattern, "gasterBlaster")
  33. elseif spawntimer >= 60 and spawntimer < 75 then
  34. FireBlasters(blasterPattern, "blast", "blastY", {"gasterBlasterFire1", "gasterBlasterFire2", "gasterBlasterFire3"}, 0.1, {"blast2", "blast3"}, 0.05, {"blastY1", "blastY2", "blastY3"}, 0.07)
  35. elseif spawntimer >= 75 and spawntimer < 80 then
  36. ClearBlasters()
  37. CreateBlasters(blasterPattern, "gasterBlaster")
  38. elseif spawntimer >= 80 and spawntimer < 95 then
  39. FireBlasters(blasterPattern, "blast", "blastY", {"gasterBlasterFire1", "gasterBlasterFire2", "gasterBlasterFire3"}, 0.1, {"blast2", "blast3"}, 0.05, {"blast2", "blastY3"}, 0.04)
  40. end
  41. end
  42. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement