Guest User

Orange Mode 3.1

a guest
Feb 8th, 2016
1,913
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.55 KB | None | 0 0
  1. --An empty wave to serve as a skeleton
  2.  
  3. mask = CreateProjectile('orangeheart', 0, 0)    --Here we make the orange heart.
  4. mask.SetVar('ignore', true)  --Image available at http://imgur.com/u6BLB1T
  5.  
  6. unmoved = true  --Initializing variables
  7. num = math.random(0, 7)
  8. xstart = 1.5*math.sin(math.pi*num/4)
  9. ystart = 1.5*math.cos(math.pi*num/4)
  10. lastx = 0
  11. lasty = 0
  12. buffer = 0
  13.  
  14. function Update()
  15.     if Player.isMoving then --This keeps track of if the player has moved at all
  16.         unmoved = false
  17.         buffer = 0  --I added a buffer for the controls
  18.         bufferx = Player.x - lastx
  19.         buffery = Player.y - lasty
  20.     end
  21.     if unmoved then
  22.         Player.MoveTo(Player.x + xstart, Player.y + ystart, false) --The initial direction of movement
  23.     elseif not Player.isMoving then
  24.         if buffer < 6 then --Now players have 6/60 = 1/10 sec to release both keys to move diagonally
  25.             Player.MoveTo(Player.x + bufferx/2, Player.y + buffery/2, false)
  26.         else
  27.             Player.MoveTo(2*Player.x - lastx, 2*Player.y - lasty, false) --Keeps the player moving     
  28.         end
  29.     end
  30.     lastx = mask.--I use the mask to set the last positions
  31.     lasty = mask.y
  32.     if Player.x == lastx and Player.y == lasty then  --Stopping against the border should hurt
  33.         Player.Hurt(1)
  34.     end
  35.     buffer = buffer + 1
  36.     mask.MoveTo(Player.x, Player.y) --Finally move the mask back to the player
  37. end
  38.  
  39. function OnHit(bullet)
  40.     if bullet.GetVar('ignore') then --I changed this to make copying into other waves eaiser.
  41.     else                            --Now you don't have to add a 'real' variable to each bullet.
  42.         Player.Hurt(1)  --Change this as you see fit
  43.     end
  44. end
Advertisement
Add Comment
Please, Sign In to add comment