I'm creating a program that makes a box move when I select it (By clicking) then clicking again where it needs to go. But this doesn't work. Instead the object moves a few pixels then stutters.
import pygame
import sys
import time
import Test_Class
from pygame import gfxdraw
pygame.init()
black = (1, 1, 1)
white = (255, 255, 255)
red = (255, 0, 0)
orange = (255, 130, 28)
light_orange = (255, 139, 36)
yellow = (231, 231, 42)
green2 = (0, 130, 15)
green = (0, 255, 0)
cyan = (60, 142, 176)
light_blue = (165, 165, 255)
blue = (0, 0, 255)
grey = (127, 127, 127)
light_grey = (191, 191, 191)
purple = (140, 57, 188)
brown = (112, 68, 37)
pink = (237, 167, 203)
dark_grey = (64, 64, 64)
display_width = 1260
display_height = 900
Bob = Test_Class.Army(400, 600)
game_display = pygame.display.set_mode((display_width, display_height))
pygame.display.set_caption("WW1 game")
clock = pygame.time.Clock()
def game_loop():
    game_exit = False
    while not game_exit:
        for event in pygame.event.get():
            if event.type == pygame.QUIT:
                game_exit = True
                pygame.quit()
                quit()
                sys.exit()
        game_display.fill(light_grey)
        Bob.shape()
        Bob.selection1()
        Bob.movement()
        pygame.display.update()
        clock.tick(60)
game_loop()
pygame.quit()
quit()
sys.exit()
import pygame
import sys
import time
from pygame import gfxdraw
pygame.init()
black = (1, 1, 1)
white = (255, 255, 255)
red = (255, 0, 0)
orange = (255, 130, 28)
light_orange = (255, 139, 36)
yellow = (231, 231, 42)
green2 = (0, 130, 15)
green = (0, 255, 0)
cyan = (60, 142, 176)
light_blue = (165, 165, 255)
blue = (0, 0, 255)
grey = (127, 127, 127)
light_grey = (191, 191, 191)
purple = (140, 57, 188)
brown = (112, 68, 37)
pink = (237, 167, 203)
dark_grey = (64, 64, 64)
display_width = 1260
display_height = 900
game_display = pygame.display.set_mode((display_width, display_height))
pygame.display.set_caption("WW1 game")
clock = pygame.time.Clock()
class Army:
    def __init__(self, posx, posy):
        self.posx = posx
        self.posy = posy
        self.movex = posx
        self.object = []
        self.movey = posy
        self.select = False
    def shape(self):
        gfxdraw.box(game_display, (self.posx, self.posy, 48, 30), black)
        gfxdraw.box(game_display, (self.posx + 2, self.posy + 2, 43, 26), blue)
        pygame.draw.line(game_display, black, (self.posx, self.posy + 1),
                         (self.posx + 47, self.posy + 28), 3)
    def movement(self):
        if self.movex > self.posx:
            self.posx += 2
        elif self.movex < self.posx:
            self.posx -= 2
        if self.movey > self.posy:
            self.posy += 2
        elif self.movey < self.posy:
            self.posy -= 2
    def selection1(self):
        mouse = pygame.mouse.get_pos()
        if self.posx + 48 > mouse[0] > self.posx and self.posy + 30 > mouse[1] > self.posy:
            click = pygame.mouse.get_pressed()
            if click[0] == 1:
                gfxdraw.box(game_display, (self.posx + 2, self.posy + 2, 43, 26), light_blue)
                pygame.draw.line(game_display, dark_grey, (self.posx, self.posy + 1), (self.posx + 47, self.posy + 28), 3)
                self.select = True
        while self.select is True:
            click = pygame.mouse.get_pressed()
            if click[0] == 1:
                print("True")
                mouse = pygame.mouse.get_pos()
                self.movex = mouse[0]
                self.movey = mouse[1]
                self.select = False
                pygame.display.update()
                clock.tick(60)Edit: Added everything required to test this.