project_game/endcap.py

17 lines
368 B
Python

class EndCap:
character = ''
color = 'blue'
passable = False
@classmethod
def endcap(cls, origin, length):
agents = []
x, y = origin
for dx in range(length):
endcap = cls((x + dx, y))
agents.append(endcap)
return agents
def __init__(self, position):
self.position = position