11 lines
322 B
Python
11 lines
322 B
Python
import random
|
|
|
|
|
|
class Apple():
|
|
def __init__(self,settings):
|
|
self.x = random.randint(1, settings.cell_w - 1)
|
|
self.y = random.randint(1, settings.cell_h - 1)
|
|
|
|
def spawn(self,settings):
|
|
self.x = random.randint(1, settings.cell_w - 1)
|
|
self.y = random.randint(1, settings.cell_h - 1) |