Blogs Article

Python TBRPG Tutorial 2: Basics! Part 1.

  • 429 views • 2 today
  • 2
  • 0
  • 1
Upper_Echelon
Level 40 : Master Geek
42
In this blog, we will be covering the basics of how to put together your Text Based RPG. We will go over terms in depth and tell you how it is used in a TBRPG. To get started, you open IDLE, the python GUI, and select file, then create a new file.
Now to the terms!

def [Name of section]():
-This statement creates a new section of code. If you want to create a checkpoint system, this comes in handy. Just use the [return] statement and the name of the section, followed by two parentheses, open and close. This is a very important part of Python!

print "[Words to print]"
-This is how one might print out words. Not with an Office Jet, but with the console. The console will have those words in the quotes put on the screen.

global [name of variable]
-This creates a variable that can be added to or subtracted from. This is helpful for a ammo system, or health. To set it you would, under it, write [name of varible]=[number of variable] .

In this tutorial, I showed you some basics of a TBRPG. Next tut, we will describe how to do inputs and such, wich some example code.
Tags

  Have something to say?

pvm_hc
06/26/2013 7:28 pm
Level 8 : Apprentice Dolphin
thx!:D
1

Welcome