'Action during a BUMPED state'

def bumped(self):

    self.rect.y += self.y_vel
    self.y_vel += self.gravity
    if (self.rect.y >= (self.rest_height + 5)):
        self.rect.y = self.rest_height
        if (self.contents == 'star'):
            self.state = c.OPENED
        elif (self.contents == '6coins'):
            if (self.coin_total == 0):
                self.state = c.OPENED
            else:
                self.state = c.RESTING
        else:
            self.state = c.RESTING
