My python text based game

Started by Tom, May 28, 2013, 02:24:56 PM

Previous topic - Next topic

Tom

Hi guys, I recently decided to try and pick up a programming language and after browsing the forum I decided to learn python.
Anyway, I made a text based game where you have to try and get out of a dungeon alive. It's really basic and probably really clumsily done but I wanted to make it all random so it is, the combat is done randomly and so is almost everything else.
If you want to take a look at it the files are below. You will need python 3.2 or later, just place all of the files in the same folder and run dungeontrudger.py to play. Tell me any bugs and also any much needed improvements (I am sure there will be many).
So yeah, that's it really. Please give me some feedback on it if you can, I plan on using pygame to develop the concept further in the future.
Thanks, Tom  :D

Jubal

I enjoyed it! Certainly a lot better than my early attempts at Python stuff.  :)

The only "bug" per se is that it'd be good if you fixed it so you at least have to choose a or b or c or whatever (the fact that you can currently hit enter or select "apple sandwiches" with no different effects kind of dispels even the illusion that you're actually choosing between paths). Using an "else" statement that says "you can't do that!" or similar and boots you back to the choice would probably be an idea.

Main features on my wish list from a few games:
- An option to see my stats, progress level, etc. This could be done kind of along with the above bugfix.
- Healing potions or food or something as a possibility in chests

More generally, maybe an option to run from enemies that gives -2 to your progress through the dungeon but at least doesn't mean you die so easily? Making the combat more interesting should possibly be the next thing to look into.

Hope to see future versions of it, it's most definitely a neat starting point.  :)
The duke, the wanderer, the philosopher, the mariner, the warrior, the strategist, the storyteller, the wizard, the wayfarer...

Tom

Thanks for the quick reply, I'm out at the moment but when I get home i will try to implement your.ideas, I also want tto add some sort of XP system and different looter. This is the longest program I've ever written so it may take me a while to sort through the mess I've made of the program. V2 with improvements will definitely be up at the end of the week with improvements :) - Tom (I typed this on my phone so please excuse stupid errors in grammar)

Tom

Okay, here is version 2.0 with:
A mechanism to try and keep you following instructions (it will hopefully be a fun little surprise ;)),
Potions de la health,
An xp system that I haven't implemented properly and is currently just hanging around doing nothing,
More choices in combat which actually work (but if you don't type a, b or c it will just proceed like you just pressed enter)
More  choices with the loots
Potion drinking and a longer dungeon (it loops 25 times now XD) but with the health potions it is possible to make it out alive (just)
I should be getting on with some revision now so I will leave this with you. You will need python 3.2 or higher to run this, just click on the dungeontrudger.py file to open it and get started. I would recommend removing all files of previous versions from your computer before you try and play because otherwise the program will get confused about which files to import.
That's it, I think it is now a lot better, hope you guys do too - Tom :)
P.S. Please excuse my horrendous programming skills and liberal use of copy and paste :)

Tom

#4
Okay, so I've been gone a very long time but I dug this up and I wanted to get back in to Python. This is a complete re-write of my dungeon crawler. It has one or two bugs but I'm at a loss for the minute about fixing them. It needs the most recent python to run and has got quite a lot more depth. I'm sorry for necroposting but I thought I should re use my own thread rather than start a new one nobody wants to look at.

To run the game just unzip it all in to one folder and run the RUNTHIS.py file.

I've been away for a while so in reality there is not much advancement at all but meh.

If anyone can be asked to take a look it would be really appreciated, thanks.

Quick note, if anyone is going to play this, obey all commands if possible unless you're ready for a boss fight.

Jubal

Ooh, welcome back! Good to see you again. :)

I'm writing an essay currently but will have a play later this evening and post again on thoughts/ideas.
The duke, the wanderer, the philosopher, the mariner, the warrior, the strategist, the storyteller, the wizard, the wayfarer...

comrade_general


Tom

Thanks, on the weekend coming up I will be able to troubleshoot it a little bit and try to iron out the bugs but tbh i'm probably going to start over.

comrade_general

Oh, I didn't mean for you to change your title, I was just saying I changed your unsure face to a smiley face on my post. :)

Tom

#9
Oh ok thanks, i'm still unsure about it all though :/   :D
Quick note, if anyone is going to play this, obey all commands if possible unless you're ready for a boss fight.

Jubal

#10
Well, I fairly rapidly accidentally hit enter at the wrong time, the manticore killed me, and now I'm dead, but still fighting the manticore somehow...  :P

EDIT: so I opted to +health after my corpse killed the manticore, which seemed to restore me to life somehow. And then I fought another couple of battles, then the game crashed when I tried to search the surrounding area after killing a giant rat.
The duke, the wanderer, the philosopher, the mariner, the warrior, the strategist, the storyteller, the wizard, the wayfarer...

Tom

Oh man that sounds like a lot went wrong none of that has happened to me before :/ oh well I'm going to make one from scratch, that used far too many recycled parts from my old one, thanks for giving it a go, the feedback is really useful. Its sounds like I've got some issues with my if and while loops ir maybe just the way I coded the game. I'm hopefully going to learn from my mistakes and make something based on dust :).

Thanks again Jubal I know its a waste of your time but I really appreciate your help.

Jubal

Not at all a waste of time, It's fun and I really like these sorts of games :) Reminds me that I should get back to work on Adventures of Soros again...
The duke, the wanderer, the philosopher, the mariner, the warrior, the strategist, the storyteller, the wizard, the wayfarer...

comrade_general

I died after throwing thermal pods. :)

Spoiler
You are travelling towards the place known as Diregloom you stumble across a dun
geon which may be a shortcut to your destination.
You decide to enter the dungeon, it is dank and dark and the smell is putrid.
You come to an intersection, which way to go? Do you go: a) Left b) Straight on
THROW THERMAL POD
This is what you get for not following simple instructions.
You fall through the floor in to a giant cavern. A giant stands in front of you.

You slash at the giant lowering its health to 275.
The giant attacks, lowering your health to 114.
Your health is at 114 and you have 2 potions left, do you want to: a) Drink one
b) Leave it THROW THERMAL POD
You slash at the giant lowering its health to 250.
The giant attacks, lowering your health to 72.
Your health is at 72 and you have 2 potions left, do you want to: a) Drink one b
) Leave it THROW THERMAL POD
You slash at the giant lowering its health to 225.
The giant attacks, lowering your health to 47.
Your health is at 47 and you have 2 potions left, do you want to: a) Drink one b
) Leave it THROW THERMAL POD
You slash at the giant lowering its health to 200.
The giant attacks, lowering your health to 18.
Your health is at 18 and you have 2 potions left, do you want to: a) Drink one b
) Leave it THROW THERMAL POD
You slash at the giant lowering its health to 175.
The giant attacks, lowering your health to -22.
Your broken body lies on the hard stone of the dungeon floor, your opponent, vic
torious, moves deeper in to the dungeon in search of more worthwile prey
Your health is at -22 and you have 2 potions left, do you want to: a) Drink one
b) Leave it

Tom

Thanks jubal and cg, I think I should add that in to my next attempt as an Easter egg for you :) I'm probably going to go for a more story based game next time :) I'm going to remove the attachment if I can to save myself from the buggy hell that is my game :P