I need help with a board game si when I get question 1 right i will move 2 spaces if i get the question i move back 1 space.
Professional Software Development Tools
I need help with a board game si when I get question 1 right i will move 2 spaces if i get the question i move back 1 space.
Hi aquataze,
I have attached an example that shows 15 squares. On Preload the object names of the squares (disabled buttons in my example) are indexed in a table so they can more easily be looked-up later.
When the "Roll Dice" button is clicked, the script on the button does the following:
1) Generates a random number between 1 and 12
2) Displays the number
3) Finds the target square by looking it up in a numerically index table
4) Finds the coordinates of that square
5) Moves the "chip" to the appropriate square
There are a couple of checks added to ensure that the chip cannot be moved past the end square (that would produce an error).
This example could probably use some optimization but its a start.
Yeah right. Who's the only one here who knows the illegal ninja moves from the government?
()))))))))o)))))))==============================================
One more thing to note: I cheezed out on the rolling of the dice. That button produces a staight random 1 - 12, not a statistically correct result.
Yeah right. Who's the only one here who knows the illegal ninja moves from the government?
()))))))))o)))))))==============================================
Sounds like it would be time for:Originally Posted by TJS
Math.RandomSeed()
Intrigued
Thank You both for the Help!
TJS... 99%, Intrigued .9 and .1 percent +/- for error
![]()
Intrigued
I played around the the previously posted example and added a few things:
1) Rolling the dice produces a realistic result
2) Added motion so that the game chip "steps" from square to square
3) Roll button gets disabled while chip is in motion
4) Added comments throughout the script
I don't know if this will help but it was fun for me. Most of the script should be easy to adjust to support things like backward motion. I image you could make Global Functions out of most of it for reuse across pages (if you game has different levels for example).
Yeah right. Who's the only one here who knows the illegal ninja moves from the government?
()))))))))o)))))))==============================================