Advertisement
Guest User

Masks

a guest
Mar 8th, 2024
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.86 KB | None | 0 0
  1. -- The bouncing bullets attack from the documentation example.
  2. timer = 0
  3. bullets = {}
  4. blasters = require "gaster_blaster"
  5. blue = require "bluesoul"
  6.  
  7. function Update()
  8.     timer = timer + 1
  9.     if timer == 1 then
  10.         --blue.Initialize()
  11.         mask = CreateSprite("Attacks/MaskBox")
  12.         mask.Scale(Arena.width/2, Arena.height/2)
  13.         mask.MoveTo(Arena.width / 2, Arena.height / 2)
  14.         mask.Mask("box")
  15.     elseif timer == 75 then
  16.         local bonetop = CreateProjectile("bones/Testboneshort", Arena.width, Arena.height - 75)
  17.         table.insert(bullets, bonetop)
  18.         timer = 0
  19.     end
  20.     for i=1, #bullets do
  21.         local bonetop = bullets[i]
  22.         bonetop.sprite.SetParent(mask)
  23.         bonetop.MoveTo(bonetop.x - 2, bonetop.y)
  24.     end
  25.     blasters.Update()
  26.     --blue.Update()
  27. end
  28.  
  29. function OnHit()
  30.     Player.Hurt(1, 0.05)
  31. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement