I made a roguelike game with Python

Overview

I created a roguelike sample game as a language study for python. Publish the project on GitHub, so this is an introductory article.

This is based on a full-scale RPG sample game, which is the subject of "Introduction to Game Development with Python" by Go Hirose, and adjustments to the game content. It is an object-oriented product.

So it may be easier to understand if you finish this introductory book before checking the code.

See the GitHub readme for a detailed description of the project.

Play Video

It is a play video. https://youtu.be/MsCe81pIWYY python_20200531_171247W_Moment.jpg

environment

Library used

pygame 1.9.6 A convenient library for creating 2D games with python https://github.com/pygame/pygame/

numpy 1.18.4 Just a little reference to the use of arrays. I just wanted to use it, so I put it in.

https://numpy.org/

Major changes from the original

In the original RPG, the battle scene was a Dragon Quest-style face-to-face battle, but we have changed it to a mechanism that allows seamless battles on the map. Also, when publishing to GitHub, all resources are replaced with my own.

Below are the main changes.

--Object-oriented production --File division by class --Battle method changed from face-to-face to seamless type --Introduction of scene and task procedures to the progress of the game --Smooth movement animation --Changed the image drawing procedure to a structure using a camera --Replacement of resources

Tools used

MusicStudio (composition)

https://apps.apple.com/jp/app/music-studio/id328608539

A DAW app that allows you to compose on your iPad. I couldn't easily find a DAW that I could easily use on Win, so I pulled out an app that I bought about 5 years ago and almost left unattended. The server mode, a function that allows you to access from a browser and download files directly, is quite good.

KanaWave (sound effect)

https://www.vector.co.jp/soft/win95/art/se232653.html

A freeware tool that allows you to create sound effects with hiragana. It is very useful when you want to make a little sound effect quickly.

Audacity (sound effect adjustment)

https://forest.watch.impress.co.jp/library/software/audacity/

A voice waveform editing tool, also freeware. It was used for adjusting the volume of audio files and converting wav to ogg.

Aseprite (pixel art)

https://store.steampowered.com/app/431730/Aseprite/?l=japanese

It is a dot creation tool. I bought it at the STEAM store. It also includes an animation confirmation tool, etc., and it is a fairly full-fledged tool, but even when you want to write a little dot, you can use it easily without stress.

Reference book

This book was the subject of this time, Anyway, it was a practical content, and it was a style of making things by moving hands first rather than explaining detailed language specifications. In the end, the full-scale RPG I referred to this time has explanations for creating games that are quite tight, such as falling block puzzles, and I think it is a very good book as an introductory book to learn while enjoying programming. On the other hand, there are few explanations about the Python language specifications, so if you can write code in this book, it seems better to keep it in another introductory book.

** ■ Introductory course on game development made with Python ** https://amzn.to/2ZNCgps [Image](https: // amzn.to/2ZNCgps)

GitHub https://github.com/becky3/python_dungeon_game_sample

Impressions

For studying Python, I was planning to finish it in a couple of days while lightly refactoring it, but I was addicted to building the game engine part, and before I knew it, it was a two-week scale work.

I used VS Code for the IDE, but it was easy to develop because it could be debugged and renamed if it was light. I also used pylint and flake8 as lint libraries, and thanks to these I learned the general coding rules for python. When studying a new language, it is quite effective to include lint for the time being.

I think I was able to make it until just before it could be used for general purposes to some extent, so I hope that I can make use of this learning and try to make a similar application on my smartphone in the future and show some development.

Recommended Posts

I made a roguelike game with Python
I made a bin picking game with Python
I made a fortune with Python.
I made a daemon with Python
I made a Christmas tree lighting game with Python
〇✕ I made a game
I made a character counter with Python
I made a Hex map with Python
I made a life game with Numpy
I made a simple blackjack with Python
I made a configuration file with Python
I made a neuron simulator with Python
I made a puzzle game (like) with Tkinter in Python
I made a competitive programming glossary with Python
I made a weather forecast bot-like with Python.
I made a GUI application with Python + PyQt5
I made blackjack with python!
I made a Twitter fujoshi blocker with Python ①
I want to make a game with Python
[Python] I made a Youtube Downloader with Tkinter.
I made a python text
I made blackjack with Python.
I made a poker game server chat-holdem using websocket with python
I made wordcloud with Python.
I made a Mattermost bot with Python (+ Flask)
I made a vim learning game "PacVim" with Go
I made a net news notification app with Python
I made a Python3 environment on Ubuntu with direnv.
I made a falling block game with Sense HAT
I made a Line-bot using Python!
Othello game development made with Python
I made a package to filter time series with python
I made a simple book application with python + Flask ~ Introduction ~
I tried a stochastic simulation of a bingo game with Python
Let's make a shiritori game with Python
I made a payroll program in Python!
I drew a heatmap with seaborn [Python]
I tried a functional language with Python
What I did with a Python array
I made a stamp generator with GAN
After studying Python3, I made a Slackbot
I made a WEB application with Django
Life game with Python [I made it] (on the terminal & Tkinter)
I made a simple circuit with Python (AND, OR, NOR, etc.)
I made a library to easily read config files with Python
I made a package that can compare morphological analyzers with Python
I made a Nyanko tweet form with Python, Flask and Heroku
I made a lot of files for RDP connection with Python
[Python] I made an image viewer with a simple sorting function.
I made a segment tree with python, so I will introduce it
I made a python dictionary file for Neocomplete
[Python] Make a game with Pyxel-Use an editor-
I tried playing a typing game in Python
Procedure for creating a LineBot made with Python
[Python] Make a simple maze game with Pyxel
I made a simple Bitcoin wallet with pycoin
I made a LINE Bot with Serverless Framework!
I want to write to a file with Python
I made a Caesar cryptographic program in Python.
I made a Python Qiita API wrapper "qiipy"
I made a QR code image with CuteR