I am sure there are better ways to write this code so any advice on streamlining it or writing it better will be appreciated. This really will not be a game I am just trying to learn how to write these routines and get them working. There will be about 10 bldgs that will work with all the functions I want to create such as a bank, shop ect... This will be text based and once I get this running and working right I will start working on making it 2D, sprite based and then on to 3D.
Anyway I have a do loop at the top calling a screen setup function then a bunch of functions. Most are stubs, the screen setup function is coded and the adventurers function has code. I know what my problem is I just don't know how to solve it.
If you run the code you will see how it works and the menu choices. If you type the choices the program will show the function name on the left, even choice 1 if I put the function name in the stub. I have put cls in there and it does not work, WHY because I have screen setup being called from the do loop.
I have tried different loops and get the same results. I have tried doing away with the do loop and just putting the screen setup stuff up and then calling the adventure guild menu and I get an error saying I have hit a function deceleration in mid program.
I am sure this is pretty basic to a lot of you but I am missing something and when I get it I will probably have one of those how stupid am I moments.
So thanks in advance!!! Here is the code for you to check out.
`Practice Text RPG
`PracticeTextRPG.dba
`======================
`Main Game Loop
do
ScreenSetUp()
loop
`========================================FUNCTIONS=============================================================
`Screen Setup function
function ScreenSetUp()
line 0, 350, 800, 350
line 0, 353, 800, 353
line 500, 0, 500, 350
line 504, 0, 504, 350
set text size 20
text 10, 365, "Character Name Armor Class Hit Points Condition Spell Point Class"
line 0, 380, 800, 380
line 208, 380, 208, 600
line 315, 380, 315, 600
line 420, 380, 420, 600
line 520, 380, 520, 600
line 640, 380, 640, 600
AdventurersGuildMenu()
endfunction
`_________________________________________Adventurers Guild functions__________________________________________
`Guild Menu
function AdventurersGuildMenu()
text 520, 10, "Thou art in the Adventurers Guild"
text 520, 30, "Create your charecters and"
text 520, 50, "build your party here"
text 515, 100, "1.) Create A Character"
text 515, 120, "2.) Add A Member To your Party"
text 515, 140, "3.) Remove A Member From Your Party"
text 515, 160, "4.) Save your Party"
text 515, 180, "5.) Leave the Game"
text 515, 200, "6) Enter the City"
text 515, 250, "Choice: "
set cursor 580, 250
input choice
select choice
case 1
set text opaque
text 580, 250, " "
CreateCharacter()
endcase
case 2
set text opaque
text 580, 250, " "
AddMember()
endcase
Case 3
set text opaque
text 580, 250, " "
RemoveMember()
endcase
Case 4
set text opaque
text 580, 250, " "
SaveParty()
endcase
case 5
set text opaque
text 580, 250, " "
LeaveGame()
endcase
case 6
set text opaque
text 580, 250, " "
EnterCity()
endcase
endselect
endfunction
function CreateCharacter()
cls
endfunction
function AddMember()
text 10, 10, "Add a member to your party"
endfunction
function RemoveMember()
text 10, 50, "Remove a Member from your party"
endfunction
function SaveParty()
text 10, 70, "Save your Party"
endfunction
function LeaveGame()
text 10, 90, "Leave the Game"
endfunction
function EnterCity()
text 10, 110, "Enter the City"
endfunction