Advertisement
Hendrix000007

fireClass

Jun 14th, 2013
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.09 KB | None | 0 0
  1. --[[
  2. THIS IS THE FIRE CLASS
  3. --]]
  4.  
  5. Fire = {}
  6.  
  7. --local sLoader = require("SpriteHelper.SpriteHelperLoader");
  8. --local magicBulletAnim = sLoader:createAnimatedSpriteWithName( "granadeSpriteSheet_1", "magicBullet", "MagicBulletSH.pshs", "magicBulletAnim")
  9.    
  10. function Fire:new()
  11.     local magicBullet = magicBulletAnim
  12.                 magicBullet:prepareAnimationNamed("magicBulletAnim")
  13.                 magicBullet:playAnimation()
  14.                 physics.addBody(magicBullet,"dynamic")
  15.  
  16.                 magicBullet.x = --Here is where I get lost this values will be parsed to the player
  17.                 magicBullet.y = --Here is where I get lost this values will be parsed to the player
  18.                
  19.                 function magicBullet:touch()
  20.                     transition.to( self, { time=20000, alpha=0, onComplete=self })
  21.                 end
  22.                
  23.                 function magicBullet:onComplete()
  24.                     self:removeSelf()
  25.                 end
  26.                
  27.                 magicBullet:addEventListener("touch", magicBullet)
  28.        
  29.         return Fire
  30. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement