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

#1 2008-09-25 08:37:13

bking0
Scratcher
Registered: 2008-09-25
Posts: 4

Is It Possible To Select More Then One Sprite At A Time ?

Hello all, im trying to make a program where you can select a group of sprites all at the same time by drawing somthing like a rectangle around them. I was wondering if this is possible? If so, how is it done?

any replies on this topic would be really appriciated!

bking0

Offline

 

#2 2008-09-25 12:18:00

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

Re: Is It Possible To Select More Then One Sprite At A Time ?

I'm pretty sure it can be done.  First, define a sprite specific variable, maybe called "Selected" on each of the selectable sprites.  You can then define actions that happen to the sprites (movement, whatever) that are initiated by keys or messages but will only happen if the individual sprite has a Selected value of 1.  You should also have the selectable sprites change apperance somehow when they are selected.

So then the task is to change the state of the Selected variable for the desired sprites.  A simple approach would be to allow the user to build a collection of selected sprites by clicking on each sprite individually.  Not as elegant as a selection rectangle, but easier to do.  The selection rectangle could be done using the pen, I suppose, and remembering a couple of mouse click positions.  Then, you would have to write the logic to decide if each sprite is "inside" or "outside" the rectangle, by testing the positions.


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

Offline

 

#3 2008-09-25 14:03:42

Jens
Scratcher
Registered: 2007-06-04
Posts: 1000+

Re: Is It Possible To Select More Then One Sprite At A Time ?

Here's a possibly interesting project for you to check out:
http://scratch.mit.edu/projects/abee/262061


Jens Mönig

Offline

 

#4 2008-09-25 14:58:13

chalkmarrow
Scratcher
Registered: 2007-05-18
Posts: 100+

Re: Is It Possible To Select More Then One Sprite At A Time ?

Here's one way to do it that seems to work, and which follows Paddle2See's suggestion:

http://scratch.mit.edu/projects/chalkmarrow/274109

Last edited by chalkmarrow (2008-09-25 14:58:27)

Offline

 

#5 2008-09-25 15:25:06

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

Re: Is It Possible To Select More Then One Sprite At A Time ?

chalkmarrow wrote:

Here's one way to do it that seems to work, and which follows Paddle2See's suggestion:

http://scratch.mit.edu/projects/chalkmarrow/274109

...And if you don't like that one, here's the version I made before I saw that Chalkmarrow had beaten me to the punch!

http://scratch.mit.edu/projects/Paddle2SeeFixIt/274123


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

Offline

 

#6 2008-09-25 15:51:41

JSO
Community Moderator
Registered: 2007-06-23
Posts: 1000+

Re: Is It Possible To Select More Then One Sprite At A Time ?

... And the one I made before I saw Paddle2see's  big_smile

http://scratch.mit.edu/projects/JSOlabs/274142

It's almost exactly the same...


http://oi48.tinypic.com/2v1q0e9.jpg

Offline

 

#7 2008-09-26 15:01:37

bking0
Scratcher
Registered: 2008-09-25
Posts: 4

Re: Is It Possible To Select More Then One Sprite At A Time ?

It wont let me open the file in scratch-says their is a bad header? Can someone help me with this?

Offline

 

#8 2008-10-04 00:29:51

vikaros
Scratcher
Registered: 2007-06-04
Posts: 100

Re: Is It Possible To Select More Then One Sprite At A Time ?

Do you have the latest version of Scratch?  That could cause the bad-header message.  Cool projects!

Offline

 

Board footer