We need to add the layout of the stars in the game and have them moving so as to add a little effect to show that they're active. A collision event will need to be applied, which would remove them when the panda collides with them.
Create a new function called
createStars()
and lay out thestar
objects in afor
loop. Add in the"collision"
event that will be called byonStarCollision()
to remove the stars when they are hit by the panda. Rotate the stars forward and backward at 10 seconds and 1,080 and -1,080 degrees each. This will allow the stars to rotate three full intervals backward and forward. Create the walls for the left and right sides of the screen:local createStars = function() local numOfRows = 4 local numOfColumns = 12 local starPlacement = {x = (display.contentWidth * 0.5) - (starWidth * numOfColumns ) / 2 + 10, y = 50} for row = 0, numOfRows - 1 do for column = 0, numOfColumns - 1 do -- Create a star ...