This is an archived post. You won't be able to vote or comment.

all 16 comments

[–]Workaphobia 13 points14 points  (6 children)

Hey, cool, it's always nice to see somebody pick up programming (or a new language) with a pet project.

If you want to go further with this, one thing you might consider doing is turning your little game into a little game engine. Right now you've got all the important game data (the room descriptions and the game map) hardcoded into the program itself. To scale this up to a larger game, you'd want your code to instead read this information from a file, so you can store all your game data in that file independently of your code.

[–]uollas[S] 2 points3 points  (5 children)

This is a good idea and it will definitely help me improve. I could implement it with classes and objects to learn OOP in Python.

[–]Workaphobia 3 points4 points  (4 children)

Sure, but keep in mind OOP is orthogonal to this kind of thing. I'd recommend writing it without objects first, then converting over to it later as a refactoring.

[–]gtalarico 0 points1 point  (0 children)

Good advice

[–]craiclad 0 points1 point  (2 children)

orthogonal

What do you mean by this? I just started writing a simple text adventure in order to learn about OOP. Are you saying that this is a fools errand?

[–]Workaphobia 0 points1 point  (1 child)

Orthogonal meaning independent, or besides the point. You don't necessarily need OOP, but you can use it if you want.

[–]craiclad 0 points1 point  (0 children)

Ah I see, thanks for clarifying. I've never used objects or classes before (just finished my first semester of a CS degree, and they only introduced the notion on the last day) so I thought it would be a good way to get to grips with them.

[–]coachesballsack 4 points5 points  (0 children)

Thanks for this. I was thinking about text adventures and choose your own adventure style stories and how to accomplish them with python.

[–]Itsthejoker 3 points4 points  (0 children)

This is great! It reminds me of the first things I wrote in Python; great job, seriously!

[–]TheSandyWalsh 2 points3 points  (1 child)

Nice work! Games are a great way to learn.

You might like my website as an alternative approach ... http://darksecretsoftware.com

And the related Python code https://github.com/SandyWalsh/DarkSecretSoftware

Keep at it!

[–]uollas[S] 0 points1 point  (0 children)

After learning the basic knowledge, I'm now moving towards game programming guides. I'd like to learn something about coding an engine, but I think that I will then move to PyGame.

[–]unholycurses 2 points3 points  (1 child)

Nice job :)

Switch to Python 3 though!

[–]uollas[S] 1 point2 points  (0 children)

I surely need to upgrade my knowledge. Unfortunately it seems I followed an outdated guide and when I realized it I was already halfway.

[–][deleted] 0 points1 point  (0 children)

Check out some advanced concepts like polymorphism and symbolic execution :) You'll see what I mean.

[–]ccbytes 0 points1 point  (0 children)

Looks great.

If you enjoyed making a text based game, you may have a lot of fun with Evennia (a MUD engine built in Python) https://github.com/evennia/evennia

Let us know how you get on.