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

#1 2012-08-31 22:13:43

Ryuusekai
New Scratcher
Registered: 2012-08-29
Posts: 1

Grouping sprites?

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

 

#2 2012-08-31 22:51:16

Wes64
Scratcher
Registered: 2011-08-19
Posts: 1000+

Re: Grouping sprites?

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


Experienced 2.0 Tester: Ask me questions!
Using Firefox 13.0, Flash plugin version 11.4.402.287, and Windows XP Professional.

Offline

 

#3 2012-08-31 23:00:02

AtomicBawm3
Scratcher
Registered: 2009-06-27
Posts: 1000+

Re: Grouping sprites?

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)


http://i50.tinypic.com/j0yw0p.jpg

Offline

 

#4 2012-08-31 23:52:02

amcerbu
Scratcher
Registered: 2009-07-21
Posts: 500+

Re: Grouping sprites?

^^ 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.

Offline

 

#5 2012-09-01 10:35:07

Wes64
Scratcher
Registered: 2011-08-19
Posts: 1000+

Re: Grouping sprites?

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]
end
obviously I wont copy the if statement 25 times but you know what I mean

Last edited by Wes64 (2012-09-01 10:35:24)


Experienced 2.0 Tester: Ask me questions!
Using Firefox 13.0, Flash plugin version 11.4.402.287, and Windows XP Professional.

Offline

 

Board footer