Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Paddle = Class{}
- function Paddle:init(x, y, width, height)
- self.x = x
- self.y = y
- self.width = width
- self.height = height
- self.dy = 0
- end
- function Paddle:update(dt)
- if self.dy < 0 then
- self.y = math.max(0, self.y + -self.dy * dt)
- elseif self.dy > 0 then
- self.y = math.min(VIRTUAL_HEIGHT - 20, self.y + self.dy * dt)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement