I just finished and published the breakout tutorial. It actually went very well. I feel like it turned out to be a nice progression from simple pieces into a full fledged game. I wrote the code and tutorials one step at a time, which made it feel more organic as I went along. It also introduced some bugs and bad design decisions as we got to the end, but I think those actually turned out to be very educational to the new programmer as I discussed them and fixed them.
I’m interested to see if people use them and how they are received. The Pong tutorial had low traffic but was fairly well liked from the feedback I received, and I think this one is better than that.
I have a couple more tutorial ideas on the drawing board, but I haven’t decided which ones I will do and at what point I will switch from pygame to using the MUA framework which uses pyglet and rabbyt (openGL) instead of pygame (SDL).
If you are enjoying (or hating!) the tutorials, please let me know! Feedback is very helpful and much appreciated. If you have certain topics you want covered, check out the list of potential tutorial ideas and leave a comment!
4 Comments
Keeyai,
Both the Pong and Breakout tutorials were well written and easy to follow. Nice Job! I just have one question. In the Breakout tutorial Step 5 Part 2, the nameEntered method should it look like this:
def nameEntered(self,name):
"""Create a location to add the new high score, max entries is 10."""
newscores = []
username = name
newscores.append((username, str(self.scoreS.score)))
self.score.score = 0 # only add the score once
newscores.append((name, score))
newscores = newscores[0:10] #only take the top 10
#write scores to high score table
highscorefile = 'highscores.txt'
f = open(highscorefile, 'w')
for name, score in newscores:
f.write("%s:%s\n" % (name, score))
f.close()
self.showHighScores(newscores) #display high scores
Thanks.
Dean
P.S – Looking forward to future tutorials.
Hi Dean,
Thanks for reading the tutorials; I’m glad you enjoyed them.
Your change to the nameEntered function seems to be not parsing the original high scores and using self.scoreS.score to fetch the current score…
I’m not sure why you did this — you need to parse the current score table to get the previously saved scores, and self.score is the score sprite that contains our current score.
You DID make me go back and look at the tutorial as posted, however, and noticed that a missing quote was badly damaging the nameEntered function. Thanks for that — it is now fixed.
Hello, just wanted to say that I love your tutorials about PyGame! They are easy to follow and I learned a lot. These are actually one of the first I see that really show what it takes to make a game, and not just show a few examples.
Just wondering if you are ever going to make more of those?
Thanks and take care,
Bart
Hi Bart,
Thanks for your praise! Yes, I plan to make more tutorials when I get some time. I actually have a few more tutorials planned out; I just need to get around to making them.
Continue to check back or subscribe to the feed (http://muagames.com/feed/rss/).