Author |
Message |
rocknroller
|
Posted: Sun Jun 08, 2008 1:13 pm Post subject: Need help with a quick code |
|
|
Hey guys im just starting turing and I need your help with a quick code
Im just wondering how you would make something for a game at the beginning that says
1. Play
2. Instructions
3. Exit
Then they would enter 1,2, and 3 and it would go to the page they wanted
Sorry if this is a "newbie" question im just kind of new to this stuff |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
apomb
![](http://compsci.ca/v3/uploads/user_avatars/6489609347028a0f2422f.png)
|
Posted: Sun Jun 08, 2008 5:09 pm Post subject: RE:Need help with a quick code |
|
|
a) if you're just starting turing, why are you trying to make a game
and
b) make a loop, outputting those options to the screen, then inside that loop make a decision structure (if then else) that does something based on input from the user |
|
|
|
|
![](images/spacer.gif) |
syntax_error
![](http://compsci.ca/v3/uploads/user_avatars/196798963948cf16794b6e5.jpg)
|
Posted: Sun Jun 08, 2008 5:15 pm Post subject: RE:Need help with a quick code |
|
|
Just to add you can also use another decision structure, called the case structure for more information please use the Turing Walkthrough since it has a a plentiful of examples. |
|
|
|
|
![](images/spacer.gif) |
talyboy
|
Posted: Sun Jun 08, 2008 5:35 pm Post subject: RE:Need help with a quick code |
|
|
or you could just use a get statement and using an if structure decide what happens then. |
|
|
|
|
![](images/spacer.gif) |
maxudaskin
|
Posted: Sun Jun 08, 2008 5:44 pm Post subject: Re: Need help with a quick code |
|
|
[Mod Edit: No need to do it for him] |
|
|
|
|
![](images/spacer.gif) |
jeffgreco13
![](http://compsci.ca/v3/uploads/user_avatars/21290830414888dd996a022.jpg)
|
Posted: Mon Jun 09, 2008 9:26 am Post subject: Re: Need help with a quick code |
|
|
Oof, if this is giving you problems then you have a long journey ahead of you if you're going to make a game.
I think you should go read a little, no, A LOT more, if you're going to make a game worth making.
Don't mean to insult but I don't think you should jump into something like this just yet. |
|
|
|
|
![](images/spacer.gif) |
Insectoid
![](http://compsci.ca/v3/uploads/user_avatars/13760332514cbd0ce972eaa.jpg)
|
Posted: Mon Jun 09, 2008 11:13 am Post subject: RE:Need help with a quick code |
|
|
I think I should add, the game is first priority. The menu comes after. |
|
|
|
|
![](images/spacer.gif) |
pkjr92
|
Posted: Thu Jun 12, 2008 9:10 am Post subject: Re: Need help with a quick code |
|
|
Yeah, I when I first used turing, I was confused about how it worked too. It's not like VB where you can move from form to form, you only have one active user-controlled run window and unless you get into procedures, it is better just to flash up the instructions at the beginning of the game, and then go straight to playing it. |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Aziz
![](http://compsci.ca/v3/uploads/user_avatars/17740604804829f8242e90c.png)
|
Posted: Thu Jun 12, 2008 9:14 am Post subject: Re: RE:Need help with a quick code |
|
|
Don't give him the answer, maxudaskin =/. And yes, the Turing Walkthrough thread http://compsci.ca/v3/viewtopic.php?t=8808 would be a great help in this.
Doing the menu should actually come first in this case, because he's going to have to struggle over that first before he can learn ANYTHING about making a game. |
|
|
|
|
![](images/spacer.gif) |
|