Alright. I'm trying to make a game where there are 36 tiles. Each tile is different, and I want each tile to come up in a different spot every time, kind of like the amounts in the cases on Deal or No Deal. Can anybody help me?! [blocks] <{ bunnies }> [/blocks]
Offline
Here's one approach....make a sprite for each tile. Define a local variable on each tile called "Position Number". Define a global variable (can be seen by all sprites) called "Counter". When Green Flag is pressed, set "Counter" to 1 and have each tile wait about a half second (so that Counter has time to be initalized) and then have each tile wait a short random amount of time and then set "Position Number" to the current value of "Counter" and change the value of "Counter" by 1. The result of all this is that each tile should end up with a different "Position Number" each time the Green Flag is clicked.
Once each one has a Position Number, you can use that to position the tile by either using lists of X and Y values for each position number or some other method. Let me know if you want a demo.
Offline
cpumaster930 wrote:
Alright. I'm trying to make a game where there are 36 tiles. Each tile is different, and I want each tile to come up in a different spot every time, kind of like the amounts in the cases on Deal or No Deal. Can anybody help me?! [blocks] <{ bunnies }> [/blocks]
ok so make 36 tile sprites. [blocks] <when green flag clicked>
<forever>
<set{ money # }to( <pick random( $5 )to( $ 1,000,000
then use that script for each sprite
Last edited by golfer3 (2009-03-21 19:06:42)
Offline