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

#1 2011-10-07 19:07:06

Zparx
Scratcher
Registered: 2011-03-23
Posts: 500+

Assigning classes to sprites! **need feedback!**

I think that we should be able to assign classes to sprites. This would be especially helpful in plat-former games. For instance, the ground sprites. Here is what someone would normally use for their scripts (this is my personal style. idk about anyone else);

when gf clicked
forever
if <(touching? [sprite 1 v]) or <(touching? [sprite 2 v]) or <(touching? [sprite 3 v]) or (touching? [etc! ;b v])>>>
//execute actions here        
end
That script always becomes a pest, and fairly large if you're making some huge plat-former/scroller

Instead of putting that code, I think we should be able to go to the menu where the scratch blocks are (upper left corner) and have another category called "Classes". It would work similar to the variables function, and when you clicked it, there would be various functions, two of which called "Create class" and "Delete class". When you create a class, you could name it whatever you want, then "assign" your created class to any sprite you wanted. Think of it as "tagging" your sprites. In this case, we would assign or "tag " the class to all of your ground sprites in the project you're making. So let's say you make a class called "ground". You could then go to all of the sprites you are going to use to simulate ground in your project, right click (or something) them, and have a menu option that says "Assign class", click that, then choose your "ground" class that you made. Then your coding would be a lot easier! Your script would look something like this after you've created and assigned your class;

when gf clicked
forever
if (touching? [class: ground v])
//execute actions here

torcado194 wrote:

It also makes it easier to sort sprites and scripts. Like if you have 50 different types of enemies but you want them all to have the same affect on the player, but do different things on their own. And maybe you could make a class a sprite on it's own as like a folder for all the different types of enemies you have so youre not shearching through thousands of sprites if you have a big game.

Would that not be one of the greatest ideas of all time?

------------------
SUPPORTERS
-------------------

* Zparx

*torcado194

*efisher82

*imaginelt

*joefarebrother

*harrypotter7890

*LS97

*muppetds

*NeilWest

*Mokat

Last edited by Zparx (2012-02-13 14:51:10)


http://images3.wikia.nocookie.net/__cb20101119183412/halo/images/4/43/Hero2.png
^ My rank on Halo: Reach :3

Offline

 

#2 2011-10-07 19:28:49

Zparx
Scratcher
Registered: 2011-03-23
Posts: 500+

Re: Assigning classes to sprites! **need feedback!**

Bump Please Look At Thisssss!!!!


http://images3.wikia.nocookie.net/__cb20101119183412/halo/images/4/43/Hero2.png
^ My rank on Halo: Reach :3

Offline

 

#3 2011-10-07 20:48:25

Zparx
Scratcher
Registered: 2011-03-23
Posts: 500+

Re: Assigning classes to sprites! **need feedback!**

bump dude


http://images3.wikia.nocookie.net/__cb20101119183412/halo/images/4/43/Hero2.png
^ My rank on Halo: Reach :3

Offline

 

#4 2011-10-07 22:04:09

Zparx
Scratcher
Registered: 2011-03-23
Posts: 500+

Re: Assigning classes to sprites! **need feedback!**

buuuummmmop


http://images3.wikia.nocookie.net/__cb20101119183412/halo/images/4/43/Hero2.png
^ My rank on Halo: Reach :3

Offline

 

#5 2011-10-08 00:14:15

Zparx
Scratcher
Registered: 2011-03-23
Posts: 500+

Re: Assigning classes to sprites! **need feedback!**

effin bump!


http://images3.wikia.nocookie.net/__cb20101119183412/halo/images/4/43/Hero2.png
^ My rank on Halo: Reach :3

Offline

 

#6 2011-10-08 11:09:11

Zparx
Scratcher
Registered: 2011-03-23
Posts: 500+

Re: Assigning classes to sprites! **need feedback!**

bump
):


http://images3.wikia.nocookie.net/__cb20101119183412/halo/images/4/43/Hero2.png
^ My rank on Halo: Reach :3

Offline

 

#7 2011-10-08 13:02:56

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Assigning classes to sprites! **need feedback!**

Yeah, but then Scratch would become a full OOP, and more confusing for beginners.

Offline

 

#8 2011-10-08 13:07:53

Zparx
Scratcher
Registered: 2011-03-23
Posts: 500+

Re: Assigning classes to sprites! **need feedback!**

LS97 wrote:

Yeah, but then Scratch would become a full OOP, and more confusing for beginners.

What do you mean? I don't think that adding classes is that confusing. I just explained it to where a 3-year old would understand it. I mean if they don't add it in scratch, then byob or panther should give it a shot at least  hmm


http://images3.wikia.nocookie.net/__cb20101119183412/halo/images/4/43/Hero2.png
^ My rank on Halo: Reach :3

Offline

 

#9 2011-10-08 15:39:34

torcado194
New Scratcher
Registered: 2010-10-11
Posts: 11

Re: Assigning classes to sprites! **need feedback!**

I agree with this idea completely. It also makes it easier to sort sprites and scripts. Like if you have 50 different types of enemies but you want them all to have the same affect on the player, but do different things on their own. And maybe you could make a class a sprite on it's own as like a folder for all the different types of enemies you have so youre not shearching through thousands of sprites if you have a big game.

Offline

 

#10 2011-10-08 18:11:12

efisher82
Scratcher
Registered: 2009-12-07
Posts: 100+

Re: Assigning classes to sprites! **need feedback!**

I think this has already been posted on here...

But I support... It's kind of like grouping objects in Microsoft Word, right? (for those who know what that is)


http://bit.ly/ApaYt4http://ow.ly/8Jemvhttp://fulltwist.net/wp-content/plugins/social-slider/icons/standard/youtube-32.png

Offline

 

#11 2011-10-08 19:06:37

torcado194
New Scratcher
Registered: 2010-10-11
Posts: 11

Re: Assigning classes to sprites! **need feedback!**

Yes exactly. And I made that thread btw XD

Offline

 

#12 2011-10-09 10:25:05

Zparx
Scratcher
Registered: 2011-03-23
Posts: 500+

Re: Assigning classes to sprites! **need feedback!**

Thanks for all of the feedback guys!  (:


http://images3.wikia.nocookie.net/__cb20101119183412/halo/images/4/43/Hero2.png
^ My rank on Halo: Reach :3

Offline

 

#13 2011-10-09 12:02:35

joefarebrother
Scratcher
Registered: 2011-04-08
Posts: 1000+

Re: Assigning classes to sprites! **need feedback!**

i agree but i don't think they should be called classes. I think they should be called tags, and maybe there can be blocks like
|tag [sprite 1 v] with ()|
that would assign a tag to a sprite,
|remove tag for [sprite 1 v]|
and
(my tag)
and the ([] of [sprite 1]) block will have another category: tag. Also there will be blocks like
<touching sprite with tag () >
and maybe even a c block like
|make every sprite with tag () do|
Also if there is a clone block it will make the clone automatically have the same tag ( and costume and position and local variables) as the 'parent' sprite.


My latest project is called http://tinyurl.com/d2m8hne! It has http://tinyurl.com/d395ygk views, http://tinyurl.com/cnasmt7 love-its, and http://tinyurl.com/bwjy8xs comments.
http://tinyurl.com/756anbk   http://tinyurl.com/iplaychess

Offline

 

#14 2011-10-09 15:01:32

efisher82
Scratcher
Registered: 2009-12-07
Posts: 100+

Re: Assigning classes to sprites! **need feedback!**

joefarebrother wrote:

i agree but i don't think they should be called classes. I think they should be called tags, and maybe there can be blocks like
|tag [sprite 1 v] with ()|
that would assign a tag to a sprite,
|remove tag for [sprite 1 v]|
and
(my tag)
and the ([] of [sprite 1]) block will have another category: tag. Also there will be blocks like
<touching sprite with tag () >
and maybe even a c block like
|make every sprite with tag () do|
Also if there is a clone block it will make the clone automatically have the same tag ( and costume and position and local variables) as the 'parent' sprite.

Umm... That might make it confusing, because tags are also search terms on the Scratch website.


http://bit.ly/ApaYt4http://ow.ly/8Jemvhttp://fulltwist.net/wp-content/plugins/social-slider/icons/standard/youtube-32.png

Offline

 

#15 2011-10-09 23:46:35

torcado194
New Scratcher
Registered: 2010-10-11
Posts: 11

Re: Assigning classes to sprites! **need feedback!**

That Is also a very good idea

Offline

 

#16 2011-10-10 10:58:40

efisher82
Scratcher
Registered: 2009-12-07
Posts: 100+

Re: Assigning classes to sprites! **need feedback!**

torcado194 wrote:

That Is also a very good idea

what is


http://bit.ly/ApaYt4http://ow.ly/8Jemvhttp://fulltwist.net/wp-content/plugins/social-slider/icons/standard/youtube-32.png

Offline

 

#17 2011-10-10 13:32:49

ImagineIt
Scratcher
Registered: 2011-02-28
Posts: 1000+

Re: Assigning classes to sprites! **need feedback!**

support!

Offline

 

#18 2011-10-11 14:12:27

joefarebrother
Scratcher
Registered: 2011-04-08
Posts: 1000+

Re: Assigning classes to sprites! **need feedback!**

efisher82 wrote:

joefarebrother wrote:

i agree but i don't think they should be called classes. I think they should be called tags, and maybe there can be blocks like
|tag [sprite 1 v] with ()|
that would assign a tag to a sprite,
|remove tag for [sprite 1 v]|
and
(my tag)
and the ([] of [sprite 1]) block will have another category: tag. Also there will be blocks like
<touching sprite with tag () >
and maybe even a c block like
|make every sprite with tag () do|
Also if there is a clone block it will make the clone automatically have the same tag ( and costume and position and local variables) as the 'parent' sprite.

Umm... That might make it confusing, because tags are also search terms on the Scratch website.

Or maybe it could be called "labels" then.


My latest project is called http://tinyurl.com/d2m8hne! It has http://tinyurl.com/d395ygk views, http://tinyurl.com/cnasmt7 love-its, and http://tinyurl.com/bwjy8xs comments.
http://tinyurl.com/756anbk   http://tinyurl.com/iplaychess

Offline

 

#19 2011-10-11 14:48:40

efisher82
Scratcher
Registered: 2009-12-07
Posts: 100+

Re: Assigning classes to sprites! **need feedback!**

joefarebrother wrote:

efisher82 wrote:

joefarebrother wrote:

i agree but i don't think they should be called classes. I think they should be called tags, and maybe there can be blocks like
|tag [sprite 1 v] with ()|
that would assign a tag to a sprite,
|remove tag for [sprite 1 v]|
and
(my tag)
and the ([] of [sprite 1]) block will have another category: tag. Also there will be blocks like
<touching sprite with tag () >
and maybe even a c block like
|make every sprite with tag () do|
Also if there is a clone block it will make the clone automatically have the same tag ( and costume and position and local variables) as the 'parent' sprite.

Umm... That might make it confusing, because tags are also search terms on the Scratch website.

Or maybe it could be called "labels" then.

Yes... That would be better.


http://bit.ly/ApaYt4http://ow.ly/8Jemvhttp://fulltwist.net/wp-content/plugins/social-slider/icons/standard/youtube-32.png

Offline

 

#20 2011-11-06 15:59:39

samtwheels
Scratcher
Registered: 2011-03-20
Posts: 1000+

Re: Assigning classes to sprites! **need feedback!**

I am currently making a mod that will support this, (OOP Blocks), which will support this. I agree that OOP is not for beginners. It would probably be best to leave it out of Scratch, to avoid confusing beginners.

Offline

 

#21 2011-11-06 20:41:09

catfan8
Scratcher
Registered: 2008-07-23
Posts: 500+

Re: Assigning classes to sprites! **need feedback!**

Hmm, This is a bit like the only feature i understood in stencyl, I like. They could add tutorials to scratch for more advanced blocks like these.


http://mag.racked.eu/cimage/i9002/Sword-In-Back+get%21/HEROBRINE+Y+U+NO+EXIST/mca.png

Offline

 

#22 2011-11-07 11:04:02

RedRocker227
Scratcher
Registered: 2011-10-26
Posts: 1000+

Re: Assigning classes to sprites! **need feedback!**

Maybe instead of having to right-click on it, there would be two more blocks (probably in control), saying 'add me to class' and 'delete me from class'. That way, you could only have it in the class for some the game. Other than that, I support!


Why

Offline

 

#23 2011-11-07 11:34:03

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Assigning classes to sprites! **need feedback!**

Zparx wrote:

LS97 wrote:

Yeah, but then Scratch would become a full OOP, and more confusing for beginners.

What do you mean? I don't think that adding classes is that confusing. I just explained it to where a 3-year old would understand it. I mean if they don't add it in scratch, then byob or panther should give it a shot at least  hmm

Sorry, I misunderstood your topic. I thought you meant the kind of classes you get in OOP (object-oriented programming): where you can make new versions of the classes during run time, etc.

This is actually a pretty good idea. Faced with this problem, I found myself having to use colors for sensing instead. Stencyl, an advanced block language inspired by  Scratch, has this feature and they call them groups (if I'm not mistaken).

Maybe we could adopt that name? Classes does sound confusing for people used to OOP.

Offline

 

#24 2011-11-08 13:27:09

Zparx
Scratcher
Registered: 2011-03-23
Posts: 500+

Re: Assigning classes to sprites! **need feedback!**

LS97 wrote:

Stencyl, an advanced block language inspired by  Scratch, has this feature and they call them groups (if I'm not mistaken).

yikes  where could I find this "Stencyl" language?  yikes  that would be awesome. do you support my idea? (:


http://images3.wikia.nocookie.net/__cb20101119183412/halo/images/4/43/Hero2.png
^ My rank on Halo: Reach :3

Offline

 

#25 2011-11-08 14:01:25

RedRocker227
Scratcher
Registered: 2011-10-26
Posts: 1000+

Re: Assigning classes to sprites! **need feedback!**

Zparx wrote:

LS97 wrote:

Stencyl, an advanced block language inspired by  Scratch, has this feature and they call them groups (if I'm not mistaken).

yikes  where could I find this "Stencyl" language?  yikes  that would be awesome. do you support my idea? (:

http://www.stencyl.com/


Why

Offline

 

Board footer