so many variables (solved)
by rennie moffat · in iTorque 2D · 11/18/2010 (7:12 pm) · 3 replies
(edit)
I think I may hav solved this. Thanks
Hi there,
I have a programming question I am hoping someone can shed some light on for me.
I am making a sports game next I believe and am going over what it might require. One thing is this....
1. I want my user to select his side. He chooses 3 players, of 3 player types. By my calculations, this give me 10 possible side make ups.
2. I want my user to be able to select his opposition. One of 6, pre made teams.
If this is true, I know I could simple have 60 levels set up. Each identical in speed etc, however only differing to accommodate for all the possible selections the user could make. Now, I am sure there is probably a much easier way to accommodate this rather than having 60 level.t2ds. I am sure, this may relate back to using "for" statements. If anyone could give me a rundown on how I might be able to program this, accommodating all possible solutions/variables I would very much be appreciative.
I think I may hav solved this. Thanks
Hi there,
I have a programming question I am hoping someone can shed some light on for me.
I am making a sports game next I believe and am going over what it might require. One thing is this....
1. I want my user to select his side. He chooses 3 players, of 3 player types. By my calculations, this give me 10 possible side make ups.
2. I want my user to be able to select his opposition. One of 6, pre made teams.
If this is true, I know I could simple have 60 levels set up. Each identical in speed etc, however only differing to accommodate for all the possible selections the user could make. Now, I am sure there is probably a much easier way to accommodate this rather than having 60 level.t2ds. I am sure, this may relate back to using "for" statements. If anyone could give me a rundown on how I might be able to program this, accommodating all possible solutions/variables I would very much be appreciative.
About the author
My thanks to Garage Games and the Garage Games Community combined with owned determination I got one game up, Temple Racer and I am looking to build more interesting, fun games for the mass market of the iOS app store.
#2
In programming, these are referred to as conditional statements, where the condition of a variable leads to a number of different possibilities. There is a Wikipedia page that describes this type of thing, which is quite a good read:
http://en.wikipedia.org/wiki/Conditional_(programming)
Torque script supports if-then-else and also the switch statement. The Toque script overview describes how to use these statements. Personally I use the switch statement a lot.
http://tdn.garagegames.com/wiki/TorqueScript&needLogin=1
11/19/2010 (9:52 pm)
Rennie,In programming, these are referred to as conditional statements, where the condition of a variable leads to a number of different possibilities. There is a Wikipedia page that describes this type of thing, which is quite a good read:
http://en.wikipedia.org/wiki/Conditional_(programming)
Torque script supports if-then-else and also the switch statement. The Toque script overview describes how to use these statements. Personally I use the switch statement a lot.
http://tdn.garagegames.com/wiki/TorqueScript&needLogin=1
#3
Yes, I am setting a lot of Globals and allowing for flexible conditions via them. So yes a lot of if(X ==true) etc.
Thanks.
11/19/2010 (11:59 pm)
Thanks Mark, Yes, I am setting a lot of Globals and allowing for flexible conditions via them. So yes a lot of if(X ==true) etc.
Thanks.
Torque Owner rennie moffat
Renman3000
just thinking aloud, how could I, for instance, if my user selects his side to be....
player1 = big
player2 = small
player3 = medium
then,
$player1 = big,
$player2 = small;
$player3 = medium;
Is there a way, that when rinkScene is loaded, the the level itself checks to see what $player1 is and so on and as such will attach he appropriate behavior to the player object vs, having the conditions I had mentioned in my first post.
Sorry for asking, but this is the next step for me in programming. What is it that I must grasp to be able to do this with ease and flexibility?