        if self.a == 0: #right
            self.rect.x += self.speed
            if self.rect.right >= width:
                self.rect.right = width
                self.a = 1
        elif self.a == 1: #down
            self.rect.y += self.speed
            if self.rect.bottom >= height:
                self.rect.bottom = height
                self.a = 2

        elif self.a == 2:
            self.rect.x -= self.speed
            if self.rect.left <= 0:
                self.rect.left = 0
                self.a = 3

        elif self.a == 3:
            self.rect.y -= self.speed
            if self.rect.bottom <= 0:
                self.rect.bottom = 0
                self.a = 4

        elif self.a == 4:
            self.rect.y -= self.speed
            if self.rect.top >= 0:
                self.rect.top = 0
                self.a = 0
