Implement a "Save Game" Feature in Python with the shelve Module
Posted by Al Sweigart in misc
This post goes into the details of how you can add a "save game" feature to your Python games.
Posted by Al Sweigart in misc
This post goes into the details of how you can add a "save game" feature to your Python games.
Posted by Al Sweigart in misc
To figure out bugs in your code, you might put in print
statements/print()
calls to display the value of variables. Don’t do this. Use the Python logging
module.
Posted by Al Sweigart in misc
I made a twitter bot that checks every hour for someone who has asked the question, “Why do homeless people have dogs?” and automatically replies, “Because a dog will love you even though you are homeless.”
Posted by Al Sweigart in misc
CircleMUD was a popular piece of server software for running a MUD, and it came with a sizeable virtual world (which the admin could modify/append to customize their fantasy world.) It would be pretty handy to use parts of this data if you were creating your own virtual world for a text adventure game, but the format of CircleMUD's data files is kind of obtuse and not amenable to manipulation.
So I wrote a few scripts to convert these files into a single XML file which is 4MB when unzipped. You can parse this file and modify it to suit your needs. It contains 1979 rooms across 30 different areas (called zones in the file), with 46 shops and 569 different "mobs" (mobile objects, which are the monsters and NPCs). There are 678 different types of objects, including 116 weapons and 154 types of armor.
Posted by Al Sweigart in misc
Math and programming have a somewhat misunderstood relationship. Many people think that you have to be good at math or made good grades in math class before you can even begin to learn programming. But how much math does a person need to know in order to program?
Posted by Al Sweigart in misc
They don’t want to learn how to program just for the sake of programming. They don’t want to learn about algorithm complexity or implicit casting. They want to make Super Mario or Twitter or Angry Birds.
Posted by Al Sweigart in misc
Posted by Al Sweigart in misc
I've completed my next book, which focuses on the Pygame library and making graphical games in Python.
Posted by Al Sweigart in misc
Download pyganim.py and example programs. (Works on both Python 2 and 3.)
Details at http://inventwithpython.com/pyganim/
Pyganim is a module that you can import into your Pygame games to handle sprite animation.
Posted by Al Sweigart in misc
IDLE is great, but over time I’ve noticed a lot of problems with IDLE that I wish someone would fix.