def spawnGrape(self, width, offsetIndex): # Don't spawn grapes off the edge of the screen self.grapes.append( Grape( random.randrange(Grape.DEFAULT_RADIUS, width - Grape.DEFAULT_RADIUS), -Grape.DEFAULT_RADIUS * (offsetIndex + 1), random.randint(Grape.MIN_VERTS, Grape.MAX_VERTS), self.grapeVelocity))
def generateNewGoal(self): self.currentVerts = random.randint(Grape.MIN_VERTS, Grape.MAX_VERTS) self.currentDisplayGrape = Grape(40, 10 + 26 + 80, self.currentVerts, 0) self.currentDisplayGrape.color = (25, 252, 0) self.randMod = random.randint(1, 5)