I am trying to make another ball spawn once two objects collide with one another, through my 'addBalls' function (file found here):
Code: Select all
balls = {}
function addBalls(x, y)
local ball = {}
ball.width = 8
ball.height = 8
ball.dy = 0
ball.dx = 0
ball.skin = skin
table.insert(balls, ball)
for ball in pairs(balls) do
love.graphics.draw(gTextures['main'], gFrames['balls'][ball.skin], ball.x, ball.y)
end
end
Code: Select all
if self.powerup:collides(self.paddle) then
powerup = false
Ball:addBalls(x,y)
end
Any help appreciated