I'm making (or trying >>; ) to make a game, what I'm trying to do is to set lots of sprites as a group. Right now, it looks like this:
http://i.imgur.com/UGRP4.png
There will be around 25+ different terrain sprites, so..
Is there a way to make it look like this?:
http://i.imgur.com/VKncI.png
I've tried to set sprites as variables, and then put those variables into another one, but I keep failing every time.. any ideas? x:
Offline
no. you're going to have to use a sensing mechanism, like color, or an invisible sensor. of if this game is more advanced you could try arrays
Offline
There is a way sort of to do the second one, but it takes just as many blocks as before...try this:
set [terrain v] to (0) set [touched v] to [false] repeat until <<(terrain)=(25)> or <(touched)=[true]>> if <touching (join[terrain](terrain))?> set [touched v] to [true] else change [terrain v] by (1) end end
Last edited by AtomicBawm3 (2012-08-31 23:00:54)
Offline
amcerbu wrote:
^^ And, unfortunately, that requires a loop. Loops in Scratch are intentionally slowed down to about 30 fps. You may have to design this project to run in turbo mode.
or you could expand the loop
set [terrain v] to [0] set [touched v] to [false] if <touching (join [terrain] (terrain) ) ?> set [touched v] to [true] stop script else change [terrain v] by [1] end if <touching (join [terrain] (terrain) )? > set [touched v] to [true] stop script else change [terrain v] by [1] end if <touching (join [terrain] (terrain) ) ?> set [touched v] to [true] stop script else change [terrain v] by [1] end if <touching (join [terrain] (terrain) ) ?> set [touched v] to [true] stop script else change [terrain v] by [1] endobviously I wont copy the if statement 25 times but you know what I mean
Last edited by Wes64 (2012-09-01 10:35:24)
Offline