Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Help with including a file
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
matt_mcn




PostPosted: Wed Nov 10, 2004 11:15 am   Post subject: Help with including a file

Im creating an rpg for my class, ive got the game going, its workin pretty good. The game is a choose your ending style game, in the game you can goto a casino and you have a choice of playing blackjack, i have created a blackjack game and included it. so if you decide to play the blackjack game in the casino, you can say yes, and the game starts inside the turing program...my problem is, is their anyway so that when the user decides to stop playing blackjack, that the rpg will continue from where it left off, cuz right now all it does is just stop working...any help would be appreciated
Sponsor
Sponsor
Sponsor
sponsor
myob




PostPosted: Wed Nov 10, 2004 11:27 am   Post subject: (No subject)

since the program will be in a loop, you set a procedure to run the casino procedure. so it should have a structure of this

code:
proc casino
    put "im in casino now woohoo"
end casino

loop
    %this is the rpg game loop
    var want_to_casino := false
    var answer : string
    put "wanna play blackjack? [Y/N]"
    get answer
    if answer = "Y" then
        want_to_casino := true
    end if
    if want_to_casino then
        casino
    else
    end if
end loop
matt_mcn




PostPosted: Wed Nov 10, 2004 11:36 am   Post subject: yeah

Can you make that so it makes sense...im not very smart with turing heres my problem:

the game starts, it gives you questions such as what would you like to do:

1 - go to the casino
2 - go clubbin

now lets say i chose to goto the casino.. i would type 1

so im in the casino, and now i have 2 choices yet again

1 - go play blackjack
2 - go meet some friends

If i choose 1, it starts up the blackjack.t program within my rpg.t program, you can gamble and what not and the blacjack will ask would you like to play again y/n... if you say no it just ends the program completely, what i want it to do is to continue back to the choice up above...

also my program is basically all procedures and if statements... so easy stuff would be helpful... thanks
myob




PostPosted: Wed Nov 10, 2004 3:10 pm   Post subject: (No subject)

in ur blackjack.t, it should be just one big procedure. check on that, if u still cant debug it, post the codes.
Hikaru79




PostPosted: Thu Nov 11, 2004 7:19 am   Post subject: (No subject)

You could also go the cheap route and have Blackjack.t just open up in a new execution window, and when you're done with Blackjack just have it close the window and you'll be back to the main world Very Happy That's what I did last year for my dice game whenever you encountered a monster in the wild--the battle screen is a seperate window.
matt_mcn




PostPosted: Thu Nov 11, 2004 11:02 am   Post subject: Thanks for all your help!

I finally figured out what to do, in my blackjack.t file I included a procedure that was in the rpg.t file, so when blackjack.t was executed you would play the casino game, and when you are done it continues where i left off.. thanks for all your help
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 6 Posts ]
Jump to:   


Style:  
Search: