Dragging object along x-axis in pygame
问题 I want to be able to drag the blue object along the x-axis (black line) using mouse so that it does not move in y-direction. When I try to drag it, nothing happens. Where is the problem? import pygame def initialize(): pygame.init() global height, width height = 600 width = 900 screen = pygame.display.set_mode((width, height)) screen.fill((255, 255, 255)) pygame.draw.line(screen, (0, 0 ,0), (0, height / 2), (width, height / 2), 3) return screen def object(): dragging = False object_1 = pygame