Author Topic: My python text based game  (Read 8754 times)

Tom

  • Citizens
    Voting Member
  • Posts: 1506
  • Karma: 4
    • View Profile
    • Awards
My python text based game
« on: May 28, 2013, 02:24:56 PM »
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
« Last Edit: January 20, 2014, 05:46:12 PM by toml1000 »

Jubal

  • Megadux
    Executive Officer
  • Posts: 35594
  • Karma: 140
  • Awards Awarded for oustanding services to Exilian!
    • View Profile
    • Awards
Re: My first python game :/
« Reply #1 on: May 28, 2013, 04:22:32 PM »
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

  • Citizens
    Voting Member
  • Posts: 1506
  • Karma: 4
    • View Profile
    • Awards
Re: My first python game :/
« Reply #2 on: May 28, 2013, 04:31:44 PM »
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

  • Citizens
    Voting Member
  • Posts: 1506
  • Karma: 4
    • View Profile
    • Awards
Re: My first python game :/
« Reply #3 on: May 29, 2013, 11:12:38 AM »
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

  • Citizens
    Voting Member
  • Posts: 1506
  • Karma: 4
    • View Profile
    • Awards
Re: My first python game :/
« Reply #4 on: January 20, 2014, 04:21:15 PM »
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.
« Last Edit: January 21, 2014, 06:46:31 AM by toml1000 »

Jubal

  • Megadux
    Executive Officer
  • Posts: 35594
  • Karma: 140
  • Awards Awarded for oustanding services to Exilian!
    • View Profile
    • Awards
Re: My first python game :/
« Reply #5 on: January 20, 2014, 04:43:11 PM »
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

  • Guest
Re: My first python game :)
« Reply #6 on: January 20, 2014, 04:46:43 PM »
New title. ^

Tom

  • Citizens
    Voting Member
  • Posts: 1506
  • Karma: 4
    • View Profile
    • Awards
Re: Slightly remaid python test based game
« Reply #7 on: January 20, 2014, 05:27:43 PM »
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

  • Guest
Re: Slightly remade python test based game
« Reply #8 on: January 20, 2014, 05:34:11 PM »
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

  • Citizens
    Voting Member
  • Posts: 1506
  • Karma: 4
    • View Profile
    • Awards
Re: Slightly remade python test based game
« Reply #9 on: January 20, 2014, 05:45:24 PM »
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.
« Last Edit: January 20, 2014, 05:50:55 PM by toml1000 »

Jubal

  • Megadux
    Executive Officer
  • Posts: 35594
  • Karma: 140
  • Awards Awarded for oustanding services to Exilian!
    • View Profile
    • Awards
Re: My python text based game
« Reply #10 on: January 20, 2014, 07:10:00 PM »
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.
« Last Edit: January 20, 2014, 07:16:13 PM by Jubal »
The duke, the wanderer, the philosopher, the mariner, the warrior, the strategist, the storyteller, the wizard, the wayfarer...

Tom

  • Citizens
    Voting Member
  • Posts: 1506
  • Karma: 4
    • View Profile
    • Awards
Re: My python text based game
« Reply #11 on: January 20, 2014, 08:24:10 PM »
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

  • Megadux
    Executive Officer
  • Posts: 35594
  • Karma: 140
  • Awards Awarded for oustanding services to Exilian!
    • View Profile
    • Awards
Re: My python text based game
« Reply #12 on: January 20, 2014, 10:00:10 PM »
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

  • Guest
Re: My python text based game
« Reply #13 on: January 21, 2014, 01:56:27 AM »
I died after throwing thermal pods. :)

Spoiler (click to show/hide)

Tom

  • Citizens
    Voting Member
  • Posts: 1506
  • Karma: 4
    • View Profile
    • Awards
Re: My python text based game
« Reply #14 on: January 21, 2014, 06:45:51 AM »
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