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

#1 2008-04-20 18:46:40

coolkid001
Scratcher
Registered: 2008-01-04
Posts: 19

randomizing maps

well i would like to make a war game where u take turns and its on a grid, so u move however many squares in the grid. I just wanna see if anyone has an idea about randomizing the map. like each little grid get randmized where some might have grass some water some trees etc. i had an idea where a variable goes to a random number and goes down until 0 (like -1 every 0.05 seconds) and somehow each little grid sprite reads that and randomizes. Any ideas? if you can even understand me....


ROFLWAFFLE

Offline

 

#2 2008-04-20 18:49:47

Bluestribute
Scratcher
Registered: 2008-01-24
Posts: 1000+

Re: randomizing maps

Just make each have a costume, and when whatever clicked switch to costume random
[blocks]<when green flag clicked>[/blocks]
[blocks]<switch to costume[ <pick random( whatever )to( whatever[/blocks]


http://img247.imageshack.us/img247/1204/bluestributett4.jpg
That's my PSN ID. I know tons of COD4 glitches. Add me as your friend. Oh, and get a headset

Offline

 

#3 2008-04-20 18:53:02

coolkid001
Scratcher
Registered: 2008-01-04
Posts: 19

Re: randomizing maps

yeah i guess that'll work! thanks!!!


ROFLWAFFLE

Offline

 

#4 2008-04-20 20:45:05

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

Re: randomizing maps

Bluestribute wrote:

Just make each have a costume, and when whatever clicked switch to costume random

That would take a lot of sprites, depending on how fine the grid is.  Another approach would be to use one sprite with a number of costumes and then move the sprite to each square in the grid, pick a random costume and stamp it.


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

Offline

 

#5 2008-04-21 01:26:07

Mayhem
Scratcher
Registered: 2007-05-26
Posts: 1000+

Re: randomizing maps

Have a look at axu's project:

http://scratch.mit.edu/projects/axu/28142


Web-spinning Spider:  http://scratch.mit.edu/projects/Mayhem/18456
3D Dungeon Adventure:  http://scratch.mit.edu/projects/Mayhem/23570
Starfighter X: http://scratch.mit.edu/projects/Mayhem/21825
Wandering Knight: http://scratch.mit.edu/projects/Mayhem/28484

Offline

 

Board footer