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:
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