Legend361

Platform Attack with Gaster Blasters

Nov 13th, 2020 (edited)
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.32 KB | None | 0 0
  1. require "Libraries/CYK/Sandboxing/WaveBegin" -- NEEDED FOR CYK TO RUN PROPERLY
  2.  
  3. Encounter["wavetimer"] = 10
  4. gblaster = require "Libraries/gaster_blasters"
  5. blue = require "Libraries/bluesoul"
  6. spawntimer = 0
  7. blastertable = {}
  8. blue.Initialize()
  9. blue.Dir("down")
  10. platforms = {}
  11. platform1 = CreateProjectile("platforms1_4", 50,0)
  12. platform2 = CreateProjectile("platforms1_4", -50,0)
  13. platform1.SetVar("safe",true)
  14. platform2.SetVar("safe",true)
  15. platform1.SetVar("speed",1)
  16. platform2.SetVar("speed",1)
  17. platform1.SetVar("vely",0)
  18. platform2.SetVar("vely",0)
  19. platform1["noGraze"] = true
  20. platform2["noGraze"] = true
  21. table.insert(platforms, platform1)
  22. table.insert(platforms, platform2)
  23. blue.enableFakePlayer = true
  24. blue.platformhitbox = -3
  25.    
  26.  
  27. function Update()
  28.     spawntimer = spawntimer + 1
  29.     blue.Update()
  30.     blue.CheckIfGrounded()
  31.     blue.platforms = platforms
  32.    
  33.     if spawntimer % 60 == 0 then
  34.         level = math.random(100)
  35.         if level > 50 then
  36.             local blaster = gblaster.New(600,600,520,230,270,0)
  37.         else
  38.             local blaster = gblaster.New(600,600,520,305,270,0)
  39.         end
  40.         table.insert(blastertable, blaster)
  41.     end
  42.     gblaster.Update()
  43. end
  44.  
  45. function OnHit(bullet)
  46.     safe = bullet.GetVar('safe')
  47.     if safe == nil then
  48.         return "150%"
  49.     end
  50. end
  51.  
  52.  
  53. require "Libraries/CYK/Sandboxing/WaveEnd" -- NEEDED FOR CYK TO RUN PROPERLY
Add Comment
Please, Sign In to add comment