Advertisement
Juaxix

Abudction code for Codea 3/4 - Ship

Nov 3rd, 2011
304
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.39 KB | None | 0 0
  1.  
  2. Ship = class()
  3.  
  4. function Ship:init(x,y)
  5.     -- you can accept and set parameters here
  6.     self.x = x
  7.     self.y = y
  8.     self.isFiring = false
  9. end
  10.  
  11. function Ship:draw()
  12.     if self.isFiring then
  13.         pushMatrix()
  14.         rotate(180)
  15.         sprite("Small World:Beam", -self.x-5, -self.y+109)
  16.         popMatrix()
  17.     end
  18.     sprite("Small World:Base Large",self.x,self.y)
  19. end
  20.  
  21.  
  22.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement