Discuss Scratch

IanSan5653
Scratcher
40 posts

Groups of Sprites and "Touching (<group>)?" block

We need some better way to organize sprites. For example, I am creating (or trying to create) a chess game, but having a group of white pieaces and a group of black pieces would make it millions of times easier. Also, we need to be able to detect if a sprite is touching a sprite in a certain group, or touching any other sprite in the project.
BoltBait
Scratcher
1000+ posts

Groups of Sprites and "Touching (<group>)?" block

You can kind of do what you want with clones.

Check out this project for a demonstration: http://beta.scratch.mit.edu/projects/10063618/

Also, if you're writing a chess game, it might pay to look at these two projects:

http://beta.scratch.mit.edu/projects/2737104 and the original http://beta.scratch.mit.edu/projects/569176

Finally, you may want to read through this thread:

http://scratch.mit.edu/forums/viewtopic.php?id=104334

I give lots of information about how to write a chess program in there specifically on pages 2 and 3.

Last edited by BoltBait (April 13, 2013 03:42:24)

Failord
Scratcher
1000+ posts

Groups of Sprites and "Touching (<group>)?" block

I had an idea: Sprite statuses. It would be a sensing function, where each sprite keeps a list of text titles, or “statuses.” Then you could have a boolean saying, <touching (dropdown menu) status?> to detect ones with the status. Then you just have “add (reporting text space) status to (Sprite1)” and “remove (RTS) status from (Sprite1).” There could also be a reporter, (number of sprites with (RTS) status)

Problems:
Already has workarounds, but they are painfully laborious.
Uses a lot of data if you have a lot of statuses on a lot of sprites.
…elipses, etc.

So I'm not sure if the ST would be interested or not.

Last edited by Failord (April 19, 2013 20:32:19)

Lightnin
Scratcher
1000+ posts

Groups of Sprites and "Touching (<group>)?" block

Could be fun! We'll be making as few changes as possible for a while though, just trying to fix the bugs and release.

Best way to help think something through would be to make a mockup project that shows your idea in action.
Failord
Scratcher
1000+ posts

Groups of Sprites and "Touching (<group>)?" block

Lightnin wrote:

Could be fun! We'll be making as few changes as possible for a while though, just trying to fix the bugs and release.

Best way to help think something through would be to make a mockup project that shows your idea in action.

Ah. It was just an idea, but after I typed it, it seemed much more feasable. I wonder if you could add it eventually? Maybe add it to the list of things to come?
kidomat43
Scratcher
22 posts

Groups of Sprites and "Touching (<group>)?" block

+1024
Blaze349
Scratcher
1000+ posts

Groups of Sprites and "Touching (<group>)?" block

IanSan5653 wrote:

We need some better way to organize sprites. For example, I am creating (or trying to create) a chess game, but having a group of white pieaces and a group of black pieces would make it millions of times easier. Also, we need to be able to detect if a sprite is touching a sprite in a certain group, or touching any other sprite in the project.
support I imagine if you were making sonic with homing attack
you could use sprite groups to do this
when green flag clicked
forever

if (<key [space v] pressed?> * (2)) then

point towards [nearest sprite of sprite group"enemy" v]
reset timer
repeat until <<touching [sprite of sprite group"enemy" v]?> or <(timer) = [10]>>

move (20) steps
end
end
end
Blaze349
Scratcher
1000+ posts

Groups of Sprites and "Touching (<group>)?" block

Lightnin wrote:

Could be fun!
so will the scratch team add it
Blaze349
Scratcher
1000+ posts

Groups of Sprites and "Touching (<group>)?" block

BoltBait wrote:

You can kind of do what you want with clones.

Check out this project for a demonstration: http://beta.scratch.mit.edu/projects/10063618/

Also, if you're writing a chess game, it might pay to look at these two projects:

http://beta.scratch.mit.edu/projects/2737104 and the original http://beta.scratch.mit.edu/projects/569176

Finally, you may want to read through this thread:

http://scratch.mit.edu/forums/viewtopic.php?id=104334

I give lots of information about how to write a chess program in there specifically on pages 2 and 3.
not really also this is a dupicate this is the original

Powered by DjangoBB