This time, after learning python and pygame to some extent, I decided to make something. I decided to make a simple but simple game, Puzzle & Dragons, which is my favorite game. I want to update the progress status from time to time (By the way, this is my first creative work)
First of all, I made it possible to move the image
paz.py
for event in pygame.event.get():
if event.type == QUIT:
pygame.quit()
sys.exit()
elif event.type == MOUSEBUTTONDOWN:
mousedown = True
elif event.type == MOUSEMOTION:
if mousedown:
x,y = event.pos
#Adjust x and y so that the mouse and image are aligned
x -= int(image.get_width() / 2)
y -= int(image.get_height() / 2)
elif event.type == MOUSEBUTTONUP:
mousedown = False
When you press the mouse with MOUSE BUTTON DOWN When moving with MOUSE MOTION When you release the mouse with MOUSE BUTTON UP think of. With this, it's just moving and it doesn't look like Puzzle & Dragons, so Next, try to get stuck in the block when you talk