def movement(pressed_keys, posx, posy, rot, rot_v, maph, et, shoot, sstart):
    (x, y) = (posx, posy)
    p_mouse = pg.mouse.get_pos()
    (rot, rot_v) = ((rot - np.clip(((p_mouse[0] - 400) / 200), (- 0.2), 0.2)), (rot_v - ((p_mouse[1] - 300) / 400)))
    rot_v = np.clip(rot_v, (- 1), 1)
    if (pressed_keys[pg.K_UP] or pressed_keys[ord('w')]):
        (x, y) = ((x + (et * np.cos(rot))), (y + (et * np.sin(rot))))
    if (pressed_keys[pg.K_DOWN] or pressed_keys[ord('s')]):
        (x, y) = ((x - (et * np.cos(rot))), (y - (et * np.sin(rot))))
    if (pressed_keys[pg.K_LEFT] or pressed_keys[ord('a')]):
        (x, y) = ((x - (et * np.sin(rot))), (y + (et * np.cos(rot))))
    if (pressed_keys[pg.K_RIGHT] or pressed_keys[ord('d')]):
        (x, y) = ((x + (et * np.sin(rot))), (y - (et * np.cos(rot))))
    if (maph[int(x)][int(y)] == 0):
        (posx, posy) = (x, y)
    if ((not shoot) and (sstart == None) and pressed_keys[pg.K_SPACE]):
        shoot = 1
    return (posx, posy, rot, rot_v, shoot)
def movement(pressed_keys, posx, posy, rot, rot_v, maph, et, shoot, sstart):
    (x, y) = (posx, posy)
    p_mouse = pg.mouse.get_pos()
    (rot, rot_v) = ((rot - np.clip(((p_mouse[0] - 400) / 200), (- 0.2), 0.2)), (rot_v - ((p_mouse[1] - 300) / 400)))
    rot_v = np.clip(rot_v, (- 1), 1)
    if (pressed_keys[pg.K_UP] or pressed_keys[ord('w')]):
        (x, y) = ((x + (et * np.cos(rot))), (y + (et * np.sin(rot))))
    if (pressed_keys[pg.K_DOWN] or pressed_keys[ord('s')]):
        (x, y) = ((x - (et * np.cos(rot))), (y - (et * np.sin(rot))))
    if (pressed_keys[pg.K_LEFT] or pressed_keys[ord('a')]):
        (x, y) = ((x - (et * np.sin(rot))), (y + (et * np.cos(rot))))
    if (pressed_keys[pg.K_RIGHT] or pressed_keys[ord('d')]):
        (x, y) = ((x + (et * np.sin(rot))), (y - (et * np.cos(rot))))
    if (maph[int(x)][int(y)] == 0):
        (posx, posy) = (x, y)
    if ((not shoot) and (sstart == None) and pressed_keys[pg.K_SPACE]):
        shoot = 1
    return (posx, posy, rot, rot_v, shoot)