You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
474 B
24 lines
474 B
Blaster = Object:extend()
|
|
|
|
function Blaster:new(x, y, owner)
|
|
self.x = x
|
|
self.y = y
|
|
self.radius = 10
|
|
self.speed = 700
|
|
self.color = { 1, 0, 0 }
|
|
self.destroy = false
|
|
self.owner = owner
|
|
end
|
|
|
|
function Blaster:draw()
|
|
--draw stuff
|
|
--love.graphics.circle("fill", self.x, self.y, self.radius)
|
|
end
|
|
|
|
function Blaster:update(dt)
|
|
if self.owner == "player" then
|
|
self.y = self.y - self.speed * dt
|
|
elseif self.owner == "enemy" then
|
|
self.y = self.y + self.speed * dt
|
|
end
|
|
end
|
|
|