Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Player = {
- x=0,
- y=0,
- width=30,
- height=50,
- velocity={x=0,xmin=3,xmax=25,y=0,ymin=3,ymax=100}, -- velocity in x and y direction
- acceleration={x=0.1, y=1.3}, -- delta velocity
- deceleration={x=0.9},
- color={red=160,green=32,blue=240,alpha=255}
- }
- Player.__index = Player
- setmetatable(Player, {
- __call = function(cls,...)
- return cls.new(...)
- end
- })
- function Player.new(init)
- init = init or {}
- local self = setmetatable(init,Player)
- return self
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement