Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Bullet = Object:extend()
- function Bullet:new()
- self.image = love.graphics.newImage("bullet.png")
- self.x = x
- self.y = y
- self.speed = 700
- -- used for collision checking
- self.width = self.image:getWidth()
- self.height = self.image:getHeight()
- end
- function Bullet:update(dt)
- self.y = self.y + self.speed*dt -- bullets will move vertically
- end
- function Bullet:draw()
- love.graphics.draw(self.image, self.x, self.y)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement