Don't have an account? Register now to chat, post, use our tools, and much more.
Latest Headlines
Online Users
There are 87 users online: 1 member, 60 guests and 26 bots. Members: None. Bots: MSN/Bing (1), Magpie Crawler (5), Googlebot (19), MSN/Bing (1).
RSS & Social Media
SAX
You must log in to view the SAX chat widget
|
| Author |
Message |
|
pcb_master

Advanced Newbie

Joined: 17 Apr 2012 Posts: 55
|
Posted: 02 Oct 2012 02:08:34 pm Post subject: The Forbidden Caves - A LUA RPG |
|
|
I am working on a text based RPG called The Forbidden Caves.
I will post my progress here.
Here is the nonfunctional code (the interpereter is broken):
Code:
local c_stage = 0
local c_branch = 0
function scrClear ()
io.write("\27[2J")
end
function rpg (stage,branch)
if stage == 0 then print "You are in a small abandoned village. There is a tavern to the WEST, a cave to the NORTH and a sign to the EAST." end
if stage == 1 and branch == 1 then print "You enter the cave and walk until it gets too dark too see. You stumble on until you just can't go any further. You turn back." end
if stage == 1 and branch == 2 then print [[The sign reads: "Welcome to the town of Pleasantville! The happy town of..." The population has been scratched out. Someone has carved into the sign: "run, while you can still can! remember, it can always see you..."]] end
interp()
end
function interp ()
c_input = io.read()
if not string.find(c_input, "GO") == nil then
arg = string.sub(c_input, 3)
if arg == "NORTH" then c_branch = 1 end
if arg == "EAST" then c_branch = 2 end
if arg == "SOUTH" then c_branch = 3 end
if arg == "WEST" then c_branch = 4 end
end
c_stage = 1
rpg ()
end
scrClear()
print([[_________ _______ ]])
print([[\__ __/|\ /|( ____ \]])
print([[ ) ( | ) ( || ( \/]])
print([[ | | | (___) || (__ ]])
print([[ | | | ___ || __) ]])
print([[ | | | ( ) || ( ]])
print([[ | | | ) ( || (____/\]])
print([[ )_( |/ \|(_______/]])
print()
print([[ _______ _______ _______ ______ _________ ______ ______ _______ _ ]])
print([[( ____ \( ___ )( ____ )( ___ \ \__ __/( __ \ ( __ \ ( ____ \( ( /|]])
print([[| ( \/| ( ) || ( )|| ( ) ) ) ( | ( \ )| ( \ )| ( \/| \ ( |]])
print([[| (__ | | | || (____)|| (__/ / | | | | ) || | ) || (__ | \ | |]])
print([[| __) | | | || __)| __ ( | | | | | || | | || __) | (\ \) |]])
print([[| ( | | | || (\ ( | ( \ \ | | | | ) || | ) || ( | | \ |]])
print([[| ) | (___) || ) \ \__| )___) )___) (___| (__/ )| (__/ )| (____/\| ) \ |]])
print([[|/ (_______)|/ \__/|/ \___/ \_______/(______/ (______/ (_______/|/ )_)]])
print()
print([[ _______ _______ _______ _______ ]])
print([[( ____ \( ___ )|\ /|( ____ \( ____ \]])
print([[| ( \/| ( ) || ) ( || ( \/| ( \/]])
print([[| | | (___) || | | || (__ | (_____ ]])
print([[| | | ___ |( ( ) )| __) (_____ )]])
print([[| | | ( ) | \ \_/ / | ( ) |]])
print([[| (____/\| ) ( | \ / | (____/\/\____) |]])
print([[(_______/|/ \| \_/ (_______/\_______)]])
io.read()
exiting = false
repeat
scrClear()
save = io.open("SAV.E", "RW")
print("TFC MENU")
print("-------------")
print("NEW GAME")
if not save == null then print("LOAD GAME") else print("NO SAVED GAME") end
print("DELETE SAVE")
print("QUIT")
print("-------------")
io.write("OPT: ")
choice = io.read()
if choice == "NEW" then
c_stage = 0
c_branch = 0
clear()
rpg(c_stage,c_branch)
end
if choice == "QUIT" then exiting = true end
until exiting == true
|
|
| Back to top |
|
|
KermMartian

Site Admin

Joined: 14 Mar 2005 Posts: 55741 Location: Earth, Sol, Milky Way
|
|
| Back to top |
|
|
pcb_master

Advanced Newbie

Joined: 17 Apr 2012 Posts: 55
|
Posted: 03 Oct 2012 08:40:27 am Post subject: |
|
|
| Oh. That's interesting... |
|
| Back to top |
|
|
KermMartian

Site Admin

Joined: 14 Mar 2005 Posts: 55741 Location: Earth, Sol, Milky Way
|
|
| Back to top |
|
|
|
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.
» Go to Registration page
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
© Copyright 2000-2013 Cemetech & Kerm Martian :: Page Execution Time: 0.033921 seconds.
|