'Why does the powerup not draw to the screen?
I've been making a breakout game recently and I've come upon a problem. So, I made a powerup function to randomly draw powerups to the screen. However when I run powerup:render, nothing happens. Where is the problem and how can I solve it?
This is the powerup:render code:
if self.inplay then
love.graphics.draw(gTextures['main'], gFrames['powerups'][math.random(1,9)],
self.x, self.y)
print('Powerup drew to the screen')
end
end
This is the place where I call the code:
powerup = Powerups:init(self.ball.x, self.ball.y)
table.insert(self.powerups, powerup)
print("Powerup inserted")
Powerups:render()
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|