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

#1 2010-01-20 18:16:51

RHY3756547
Scratcher
Registered: 2009-08-15
Posts: 1000+

Object Groups - shorter scripts FTW!

It would be great if objects could be put in groups that we could use to detect collisions for objects of the same type, report variables and much more.

Here's how it would work.

Say we made a group called enemies. There would be "Add me to group ()" and "Remove me from group()" blocks, as well as "Empty group" etc. Now, we make a lot of enemies and add them to the Ememies group. Now - in the unfortunate player who has to face these enemies' scripts we put something like "if touching (Group (enemies)) { Set (Y-velocity) to (Y-velocity of (Trigger If))". Trigger if would refrence to the object from the group that the script interacted with.

An example of this would be the implementation in The Sims Carnival Game Creator. Trust me - it made multiple object collision a LOT easier.

Offline

 

#2 2010-01-20 18:34:37

GirWaffles64
Scratcher
Registered: 2009-08-09
Posts: 1000+

Re: Object Groups - shorter scripts FTW!

RHY3756547 wrote:

It would be great if objects could be put in groups that we could use to detect collisions for objects of the same type, report variables and much more.

Here's how it would work.

Say we made a group called enemies. There would be "Add me to group ()" and "Remove me from group()" blocks, as well as "Empty group" etc. Now, we make a lot of enemies and add them to the Ememies group. Now - in the unfortunate player who has to face these enemies' scripts we put something like "if touching (Group (enemies)) { Set (Y-velocity) to (Y-velocity of (Trigger If))". Trigger if would refrence to the object from the group that the script interacted with.

An example of this would be the implementation in The Sims Carnival Game Creator. Trust me - it made multiple object collision a LOT easier.

This idea has been in my head for years. Now somebody agrees with me!

(does victory dance)


hey kiddoes i'm back

Offline

 

#3 2010-01-20 18:36:09

Lucario621
Community Moderator
Registered: 2007-10-03
Posts: 1000+

Re: Object Groups - shorter scripts FTW!

I support.


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

Offline

 

#4 2010-01-21 01:05:09

MyRedNeptune
Community Moderator
Registered: 2007-05-07
Posts: 1000+

Re: Object Groups - shorter scripts FTW!

That feature would be helpful! I support as well. :-D


http://i52.tinypic.com/5es7t0.png I know what you're thinking! "Neptune! Get rid of those filthy advertisements and give us back the Zarathustra siggy, you horrible person!" Well, don't worry about it, the Zara siggy will be back soon, new and improved! ^^ Meanwhile, just do what the sig tells you to. >.>

Offline

 

#5 2010-01-21 01:15:36

Chrischb
Scratcher
Registered: 2008-07-24
Posts: 1000+

Re: Object Groups - shorter scripts FTW!

I support!  big_smile


I fall: It's a tragedy. You fall: It's comedy.
Hmph enjoy your fall - I get a lovely spring... without pans of new leaves.

Offline

 

#6 2010-01-21 14:36:40

RHY3756547
Scratcher
Registered: 2009-08-15
Posts: 1000+

Re: Object Groups - shorter scripts FTW!

Woo.

Offline

 

#7 2010-01-21 14:46:26

juststickman
Scratcher
Registered: 2009-05-31
Posts: 1000+

Re: Object Groups - shorter scripts FTW!

Support. Definitely support. I NEED THIS!!!


http://is.gd/iBQi2 Add grob to your sig and help with world dominiation!http://is.gd/iBQ9Q                                                             Hey guys, we're seriously naming our team bob?

Offline

 

#8 2010-01-22 04:35:26

fanofcena
Scratcher
Registered: 2008-07-03
Posts: 1000+

Re: Object Groups - shorter scripts FTW!

support granted . I think byobs nxt version is going to have something lik this


http://i53.tinypic.com/2vxr2c0.png Click whats above u might make a cute planet happy ^_^

Offline

 

#9 2010-01-22 08:39:05

Lightnin
Scratch Team
Registered: 2008-11-03
Posts: 1000+

Re: Object Groups - shorter scripts FTW!

Yep - this reminds me of the concept of class in object oriented programming. A cool idea - and it would be really useful!

There's always that tension between adding more features and maintaining ease of use. Could this be done in a way that would be easy and intuitive for a new Scratcher? (Or at least not be too confusing). These are the kinds of things we discuss at length in meetings we have about new features for Scratch.

If you like, you could make a mockup of how exactly this feature might look and work - complete with blocks and everything. It's always good to make nice graphics to help flesh out an idea!


Help Scratchers make the leap to 2.0!
http://img818.imageshack.us/img818/6844/transitionteam.jpg

Offline

 

#10 2010-01-22 11:53:28

RHY3756547
Scratcher
Registered: 2009-08-15
Posts: 1000+

Re: Object Groups - shorter scripts FTW!

Lightnin wrote:

Yep - this reminds me of the concept of class in object oriented programming. A cool idea - and it would be really useful!

There's always that tension between adding more features and maintaining ease of use. Could this be done in a way that would be easy and intuitive for a new Scratcher? (Or at least not be too confusing). These are the kinds of things we discuss at length in meetings we have about new features for Scratch.

If you like, you could make a mockup of how exactly this feature might look and work - complete with blocks and everything. It's always good to make nice graphics to help flesh out an idea!

OK - I'll make some mockups right now.  smile

Offline

 

#11 2010-01-22 12:51:54

RHY3756547
Scratcher
Registered: 2009-08-15
Posts: 1000+

Re: Object Groups - shorter scripts FTW!

OK - here's a mockup of what the blocks will look like:
http://i364.photobucket.com/albums/oo85/RHY3756547/Example1.gif

Offline

 

#12 2010-01-22 13:47:19

fg123
Scratcher
Registered: 2008-11-13
Posts: 1000+

Re: Object Groups - shorter scripts FTW!

Awesome!  big_smile

2010'th post!

Last edited by fg123 (2010-01-22 13:49:10)


Hai.

Offline

 

#13 2010-01-22 16:39:23

Lucario621
Community Moderator
Registered: 2007-10-03
Posts: 1000+

Re: Object Groups - shorter scripts FTW!

Hmm. We actually got a 'response'. That must be a good thing  tongue

Anyway, it seems too much like lists. (not just the color). How about a block so you can add a different sprite to Players or a group (not just yourself). Also make some mock-ups for the sensing blocks and stuff, so you can sense if your touching an enemy or wall etc.


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

Offline

 

#14 2010-01-22 18:07:34

filo5
Scratcher
Registered: 2008-01-08
Posts: 1000+

Re: Object Groups - shorter scripts FTW!

And then it's hooray for classes, interfaces and strong typing, which will make Scratch another C#, just more blockier. I like this idea BTW, but IMHO - it's kind of too hard for an average scratcher (the mean average was taken down by some people).


Converting my Scratch projects to Python!

Offline

 

#15 2010-01-22 18:40:26

RHY3756547
Scratcher
Registered: 2009-08-15
Posts: 1000+

Re: Object Groups - shorter scripts FTW!

Lucario621 wrote:

Hmm. We actually got a 'response'. That must be a good thing  tongue

Anyway, it seems too much like lists. (not just the color). How about a block so you can add a different sprite to Players or a group (not just yourself). Also make some mock-ups for the sensing blocks and stuff, so you can sense if your touching an enemy or wall etc.

For the colour - we can use Dark Brown.

I actually think the similarity to lists is a good thing - because for a start the list blocks are actually really good, and it'll get people familiar with the interface faster if they've already used lists.

I will make the mock-ups for those soon.  smile

Offline

 

#16 2010-01-23 08:19:53

RHY3756547
Scratcher
Registered: 2009-08-15
Posts: 1000+

Re: Object Groups - shorter scripts FTW!

Example of Functionality:
http://i364.photobucket.com/albums/oo85/RHY3756547/FuncExample.gif
This code would find out if the sprite is touching any member of the "Platforms" group, and if it is then it would change it's own X by the xvelocity of the group member it touched's Xvelocity.

The second code detects whether the sprite is in the group, and if it is the cat simply says something.

Last edited by RHY3756547 (2010-01-23 08:20:34)

Offline

 

#17 2010-01-23 08:43:43

juststickman
Scratcher
Registered: 2009-05-31
Posts: 1000+

Re: Object Groups - shorter scripts FTW!

filo5 wrote:

And then it's hooray for classes, interfaces and strong typing, which will make Scratch another C#, just more blockier. I like this idea BTW, but IMHO - it's kind of too hard for an average scratcher (the mean average was taken down by some people).

But the average scratcher can't even implement correct y-velocity anymore...


http://is.gd/iBQi2 Add grob to your sig and help with world dominiation!http://is.gd/iBQ9Q                                                             Hey guys, we're seriously naming our team bob?

Offline

 

#18 2010-01-23 09:54:27

filo5
Scratcher
Registered: 2008-01-08
Posts: 1000+

Re: Object Groups - shorter scripts FTW!

Let's make a reporter block (this sprite), which will be used in the <Group contains (Sprite)> -> <Group contains (this sprite)>. It's essential for object-oriented programming. An object must be aware of itself. And this will be still very easy.


Converting my Scratch projects to Python!

Offline

 

#19 2010-01-23 17:24:54

RHY3756547
Scratcher
Registered: 2009-08-15
Posts: 1000+

Re: Object Groups - shorter scripts FTW!

filo5 wrote:

Let's make a reporter block (this sprite), which will be used in the <Group contains (Sprite)> -> <Group contains (this sprite)>. It's essential for object-oriented programming. An object must be aware of itself. And this will be still very easy.

Yeah - objects always need to be aware of themselves. But I'm sure the (if touching(<groupnamehere>) ) will not work with itself, as then it would always report true.  tongue

Last edited by RHY3756547 (2010-01-23 17:25:03)

Offline

 

#20 2010-01-23 17:44:32

illusionist
Retired Community Moderator
Registered: 2008-07-02
Posts: 1000+

Re: Object Groups - shorter scripts FTW!

http://i45.tinypic.com/20rtvmw.png

How is this?
I think its about time we broke up the variables category!  lol


http://i.imgur.com/8LX1NrV.png

Offline

 

#21 2010-01-23 18:59:49

RHY3756547
Scratcher
Registered: 2009-08-15
Posts: 1000+

Re: Object Groups - shorter scripts FTW!

illusionist wrote:

http://i45.tinypic.com/20rtvmw.png

How is this?
I think its about time we broke up the variables category!  lol

Why not rename it? "Variables" is kind of one way - I didn't know lists existed to start with.

Offline

 

#22 2010-01-23 19:09:12

Lucario621
Community Moderator
Registered: 2007-10-03
Posts: 1000+

Re: Object Groups - shorter scripts FTW!

RHY3756547 wrote:

illusionist wrote:

http://i45.tinypic.com/20rtvmw.png

How is this?
I think its about time we broke up the variables category!  lol

Why not rename it? "Variables" is kind of one way - I didn't know lists existed to start with.

Breif history of Lists. One of the members of the Scratch Team is Jens. He lives in Germany. He does many hacks with scratch, and he created BYOB, and many alternate Scratch Elements. One of the things he made was lists. The Scratch Team decided to put it into the next version of scratch. done.


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

Offline

 

#23 2010-01-23 19:41:48

RHY3756547
Scratcher
Registered: 2009-08-15
Posts: 1000+

Re: Object Groups - shorter scripts FTW!

Lucario621 wrote:

RHY3756547 wrote:

illusionist wrote:

http://i45.tinypic.com/20rtvmw.png

How is this?
I think its about time we broke up the variables category!  lol

Why not rename it? "Variables" is kind of one way - I didn't know lists existed to start with.

Breif history of Lists. One of the members of the Scratch Team is Jens. He lives in Germany. He does many hacks with scratch, and he created BYOB, and many alternate Scratch Elements. One of the things he made was lists. The Scratch Team decided to put it into the next version of scratch. done.

Relation to my post = 1%.

Offline

 

#24 2010-01-23 19:46:34

greenflash
Scratcher
Registered: 2009-05-27
Posts: 1000+

Re: Object Groups - shorter scripts FTW!

This would be awesome! I don't think it needs to be broken into other categories though.


http://i48.tinypic.com/2wrkirk.pnghttp://i46.tinypic.com/6r5zk7.pnghttp://i45.tinypic.com/2vtxr1t.png

Offline

 

#25 2010-01-24 07:52:42

RHY3756547
Scratcher
Registered: 2009-08-15
Posts: 1000+

Re: Object Groups - shorter scripts FTW!

greenflash wrote:

This would be awesome! I don't think it needs to be broken into other categories though.

Yeah - I just think they should also rename the "Variables" section to something more general though.

Offline

 

Board footer