So my Powerup class document is one of the guys, in the src folder.
And the quad will come from 'breakout.png' in the graphics
folder, all well and good.
Powerup is added to what main loads:
Main delegates update to PlayState:
Main then delegates draw to Playstate. (Thus main
calls the love.draw() function and places render within it!)
From Playstate, things are a bit different. Powerup gets added to
what is referenced, only Powerup is not initially in play; so I
instantiate it here:
First thing in PlayState update, I put it in play:
Then it gets updated with respect to dt ie every frame:
Finally it is rendered:
Powerup, the class looks like this; there is no call to love draw -
same as for the other merely rendered objects - but the render is conditional
on being inPlay.
No comments:
Post a Comment