def floaty_sheep(datadir, clock): '''Make an inert sheep unaffected by gravity''' sheep_frame = util.load_frame(datadir, 'sheep') sheep = components.entity('Sheep', clock, location=(500, 400), motion=components.motion(), graphics=components.graphics(None), hitpoints=2) sheep.set_frame(sheep_frame) components.physics(sheep) sheep.physics.add(physics.apply_friction(0.5), components.physics.GROUP_VELOCITY) return sheep
def regular_physics(entity): ''' Returns a physics object with added velocity and location calculators and affected by gravity. ''' p = components.physics(entity) return p