示例#1
0
	def __init__ (self, world, pos, vel, radius = conf.ASTEROID['max radius'], density = conf.ASTEROID['density']):
		self.world = world
		GravitySink.__init__(self, pos, vel, density * radius ** 3, radius)
		self.graphic = Graphic('asteroid.png',
							   (ir(pos[0] - radius), ir(pos[1] - radius)))
		self.graphic = mk_graphic(self)
		position_graphic(self)
示例#2
0
	def move (self, phys, t):
		GravitySink.move(self, phys, t)
		x, y = self.pos
		position_graphic(self)