Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

[Python] Hiccups Progress

There are two projects I am planning on making while learning Python.
  • A short text based rpg sorta thing
  • A working version of the Risk game

So with that somewhere at the back of my mind I rush ever onwards into the vast world of Python!

Current progress:
Code:
 

# This is a display of my current work done in python

nil = 0

name_long = 7

print "Hello. Welcome to your adventure."

name = raw_input("What is your name?")

name_len = len(name)

if name_len >= name_long:

     print "Wow, %s is a long name!" %s (name)

elif name_len = nil:

     print "You have not put in a name..."

else:

     "You have a nice name. %s" %s (name)

 
Anyway, it looks like I've got a few good things down for the text based rpg thing...
I'll be learning more soon, so yeah... Come back and check my progress.
(If this is the wrong place to post this sorta thing, feel free to move it :thumb: )
 
Text based RPGs in procedural languages are very difficult to produce, it's actually easier to produce a graphical game than a text-based game.

If I were to do a text based RPG again, the one thing I'd do different is program it as if it were graphical and then write a text display, the display should be kept separate from the logic to keep it at least somewhat manageable.
 
Thought it would be quite a simple task with this sort of thing. I don't really know exactly how to import and display images with Python yet...
I presumed a textbased rpg (or a short one) would go something like this:
Code:
 

nil = 0

Switch_one = False

Switch_two = False

print "You walk into your garden. Your door is locked."

print "(To see commands, type "Help")

option_one = raw_input("what would you like to do)

if option_one = "Help":

print "To look around, Type 'Look' To move objects type 'Move' and then the object you would like to move. If you would like to pick up an item, type 'Pick Up' then the item you would like to pick up."

#I presume you can just leave else blank

elif:

print "Did you type an option?

else:

if option_one = "Look":

print "Your lovely garden looks beautiful. All that work you did sure payed off. You notice several things. Your mat is slightly jogged from where you left it this morning. Perhaps the post man wasn't paying attention. Your plant pot next to the door is in the same position as usual."

elif:

print "Did you type an option"

else:

if option_one = "Move" or "move":

print "What would you like to move?"

if pickup_one = "Mat" or "mat":

print "You pick up the mat... A few bugs crawl out from underneath. You place the mat back down"

elif pickup_one = "Plant Pot" or "Plant pot" or "plant pot" or "plant Pot":

print "Underneath the plant pot there is a shiney key!"

 

That is the basic jist of it. Right now I can't really be bothered to type it all out and I'm pretty sure I've missed something important but it's a good start right?

I just re-read it in the post, there are a few silly mistakes really but meh. Can't be bothered to change them right now...
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top