def BeginContact(self, contact):
    if ((self.env.hull == contact.fixtureA.body) or (self.env.hull == contact.fixtureB.body)):
        self.env.game_over = True
    for leg in [self.env.legs[1], self.env.legs[3]]:
        if (leg in [contact.fixtureA.body, contact.fixtureB.body]):
            leg.ground_contact = True
def BeginContact(self, contact):
    if ((self.env.hull == contact.fixtureA.body) or (self.env.hull == contact.fixtureB.body)):
        self.env.game_over = True
    for leg in [self.env.legs[1], self.env.legs[3]]:
        if (leg in [contact.fixtureA.body, contact.fixtureB.body]):
            leg.ground_contact = True