[PYTHON] Create a game to control puzzle & dragons drops using pygame

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

Recommended Posts

Create a game to control puzzle & dragons drops using pygame
Create a game UI from scratch with pygame2!
I tried to make a ○ ✕ game using TensorFlow
Create a shogi game record management application using Django 5 ~ Pass DB data to Template ~
Create a shogi game record management app using Django 4 ~ Create View ~
How to make a simple Flappy Bird game with pygame
I made a game called Battle Ship using pygame and tkinter
Create a shogi game record management app using Django 2-Database settings-
Create a shogi game record management app using Django 6 ~ Template division ~
How to create a CSV dummy file containing Japanese using Faker
Create a command line tool to convert dollars to yen using Python
Create a python GUI using tkinter
Steps to create a Django project
Create a nested dictionary using defaultdict
How to create a Conda package
How to create a virtual bridge
How to create a Dockerfile (basic)
5 Ways to Create a Python Chatbot
Create a CRUD API using FastAPI
How to create a config file
Create a C wrapper using Boost.Python
Create a shogi game record management app using Django 3 ~ Django default management site settings ~
Create a tool to automatically furigana with html using Mecab from Python3
If you were to create a TODO application (distributed) using only Python-extension 1
[Python] [Word] [python-docx] Try to create a template of a word sentence in Python using python-docx
I tried to create a sample to access Salesforce using Python and Bottle
I tried to create a linebot (implementation)
How to create a clone from Github
Create a bot to retweet coronavirus information
How to create a git clone folder
I tried to create a linebot (preparation)
How to draw a graph using Matplotlib
I tried playing a ○ ✕ game using TensorFlow
Create a graph using the Sympy module
[Python] Create a Batch environment using AWS-CDK
How to install a package using a repository
Various ways to create a dictionary (memories)
How to create a repository from media
Script to create a Mac dictionary file
Create a dataframe from excel using pandas
Go beginner tried to create a cloud native web application using Datastore / GAE
How to quickly create a morphological analysis environment using Elasticsearch on macOS Sierra
Try to create a Todo management site using WebSocket with Django (Swamp Dragon)
Create a web app that converts PDF to text using Flask and PyPDF2