Omnimaga

Calculator Community => Other Calculators => Topic started by: BalancedFury on September 20, 2011, 09:33:43 pm

Title: I need help..
Post by: BalancedFury on September 20, 2011, 09:33:43 pm
I'm making my first game : Slider of Death, and i'm stuck...
I don't know how to limit the number of slides allowed.. :(
I really need help! :crazy:
Title: Re: I need help..
Post by: sqrt(Time) on September 20, 2011, 11:04:28 pm
Your question was a little vague, but I think what you want is something like:
-Make a variable for storing the number of slides so far - start it with 0.
-When users does a slide, add one to that variable.
-After the slide has been completed, check if they've won; assuming they have, thentell them and the game.
-Else, check if the number of slides so far = the limit; assuming they have, then tell them they've lost. Else, wait for the next move.
Title: Re: I need help..
Post by: Michael_Lee on September 20, 2011, 11:24:45 pm
First off, what is a slide?

Also, do you think you can post a sample of your code or a reasonably detailed summary of your code?

Without really knowing what you're having trouble with, it's hard to help you :)
Title: Re: I need help..
Post by: BalancedFury on September 21, 2011, 09:12:08 pm
First off, what is a slide?

Also, do you think you can post a sample of your code or a reasonably detailed summary of your code?

Without really knowing what you're having trouble with, it's hard to help you :)
Im making a game that contains a series of sliding puzzles. I am trying to limit the number of slides until it is game over.
Title: Re: I need help..
Post by: Happybobjr on September 21, 2011, 10:39:49 pm
How about you program that in after the actual framework of the program.  then you can easily add it in w/o working around it.
Title: Re: I need help..
Post by: Yeong on September 22, 2011, 07:23:26 am
set a variable.
so like num_of_trial -> C
and you can decrease C whenever you use a turn so you can include like C-1->C
and you can put game over if C=0.
Title: Re: I need help..
Post by: BalancedFury on September 22, 2011, 09:55:26 pm
Thanks for helping me!
Thank you Come Again~ Ding!(Chinese Bell Sound)