def spawn(total_frames, FPS): if total_frames % (FPS * FruitsBonus.bonusTimeGeneration) == 0 and total_frames >0: # have to put the music randTile = randint(1,601) # get a randow number tile, we have 600 tiles in the screen while(not Tile.isTileFree(randTile)): # check if actually, that tile is free, or other words, it's an empty path randTile = randint(1,601) # get a randow number tile, we have 600 tiles in the screen tile = Tile.get_tile(randTile) # get the tile, randTile is just the tile number FruitsBonus(tile.x, tile.y) # have to get the x and y from the tile number now
def spawn(total_frames, FPS): if total_frames % (FPS * LifeBonus.bonusTimeGeneration) == 0 and total_frames >0: luckBonus = randint(1,4) # in other words, player has 33.33% of gain a heart life, each 30 seconds if luckBonus == 1: # new heart will show up if the rand luck bonus is 1 # have to put the music randTile = randint(1,601) # get a randow number tile, we have 600 tiles in the screen while(not Tile.isTileFree(randTile)): # check if actually, that tile is free, or other words, it's an empty path randTile = randint(1,601) # get a randow number tile, we have 600 tiles in the screen tile = Tile.get_tile(randTile) # get the tile, randTile is just the tile number LifeBonus(tile.x, tile.y) # have to get the x and y from the tile number now