This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2009-03-21 18:41:07

cpumaster930
Scratcher
Registered: 2009-02-23
Posts: 100+

I need help with a game for school!!

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]


http://i.imgur.com/Qd0lu.png

Offline

 

#2 2009-03-21 19:04:12

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: I need help with a game for school!!

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.


http://i39.tinypic.com/2nav6o7.gif

Offline

 

#3 2009-03-21 19:04:48

golfer3
Scratcher
Registered: 2008-11-02
Posts: 1000+

Re: I need help with a game for school!!

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

 

Board footer