Complete Roguelike Tutorial, using python3+pysdl2, part 1
This tutorial is a draft, an unfinished tutorial. Feel free to talk and edit but do it knowing that much is yet to be done.
This is part of a series of tutorials; the main page can be found here.
Showing the character on screen
Time to work with rl.py - the shiny part our game. Create it in the project's folder.
For this step we're going to need a character sprite. Don't worry, we will draw some letters in the tradition of roguelikes later on. But for now lets use an image. We're using art by David E. Gervais, available here under CC BY 3.0 license. Specifically we're using ``HalfOgreFighter3.png``, because, well, they look mighty! Note that those sprites are in 54x54 resolution. And they have a pink background. A proper sized version with transparent background is available at the project's GitHub. Create a resources folder and save the image on it. Save the license there too, so that we do not forget to give the author its deserved credits.
By now your project's folder should look like this:
+-pysdl2-roguelike-tutorial/ | +-constants.py | +-manager.py | +-rl.py | +-resources/ | | | +-davir_gervais_tileset.license | | | +-HalfOgreFighter3.png | +-util/ | +-time.py
Because we did some hard work creating our Manager, SceneBase, etc., we won't even need to import sdl2 for this part. All we need is to import those classes (and Resources) from manager:
Let's put Inheritance to work by subclassing SceneBase:
That would be all for now. To test, at the end of the rl.py, adding the belo lines and run it:
And now we should be able to see a mighty half-ogre in the middle of a black screen: