Advertisement
CaptainSpaceCat

Vector

Jun 13th, 2015
331
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.31 KB | None | 0 0
  1. local Object = {
  2. xPos = 0,
  3. yPos = 0,
  4. xVel = 0,
  5. yVel = 0
  6. }
  7.  
  8. function Object:new(xPos, yPos, xVel, yVel)
  9.     local class = {xPos = xPos, yPos = yPos, xVel = xVel, yVel = yVel}
  10.     setmetatable(class, self)
  11.     self.__index = self
  12.     return class
  13. end
  14.  
  15. function Object:move()
  16.     xPos = xPos + xVel
  17.     yPos = yPos + yVel
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement