import random class Apple(): def __init__(self,settings): self.x = 7#random.randint(1, settings.cell_w - 1) self.y = 5#random.randint(1, settings.cell_h - 1) self.coords = {'x':self.x,'y':self.y} def spawn(self,settings): self.x = random.randint(1, settings.cell_w - 1) self.y = random.randint(1, settings.cell_h - 1)