Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Better physics
- 640257SH
- Scratcher
27 posts
Better physics
My game, https://scratch.mit.edu/projects/520395549/ , has a problem. When two blue blocks are touching each other, even with nothing under them, they will not fall. Only when there are no blocks around it with the color it will fall. I need to make it so it falls as a big chunk when the whole thing is separated.
when I receive [scratch time v]
glide (energy) secs to x: (computerX) y: (computerY)
repeat until <<(energy) < [10]> or <(bored) = [true]>>
if <(struggle) = [true]> then
say [help me please]
else
code
end
end
- TheAnomalousPseudo
- Scratcher
1000+ posts
Better physics
I think you'll have to make a mapping script of some sort. Make a variable like “ID” or “coordinates.” Then, figure out a convenient way to label each axis, such as letters on one and numbers on the other. Each time a block is destroyed, check if any of the spaces are taken. If there is an empty space, move all the blocks above it down one space.
We ought to be careful with that octopus that takes over the servers. He's well armed.
- 640257SH
- Scratcher
27 posts
Better physics
I tried this, but I struggled because since it is is mainly made up of clones. Is there a way to make a map with clones? I think you'll have to make a mapping script of some sort. Make a variable like “ID” or “coordinates.” Then, figure out a convenient way to label each axis, such as letters on one and numbers on the other. Each time a block is destroyed, check if any of the spaces are taken. If there is an empty space, move all the blocks above it down one space.
when I receive [scratch time v]
glide (energy) secs to x: (computerX) y: (computerY)
repeat until <<(energy) < [10]> or <(bored) = [true]>>
if <(struggle) = [true]> then
say [help me please]
else
code
end
end
- TheAnomalousPseudo
- Scratcher
1000+ posts
Better physics
Yes the variable “ID” or “coords” should be a “this sprite only” variable. That way each clone will have separate coordinates.
We ought to be careful with that octopus that takes over the servers. He's well armed.
- 640257SH
- Scratcher
27 posts
Better physics
I still have trouble thinking about it, because I need clones to communicate to each other somehow, which I cannot grasp.
when I receive [scratch time v]
glide (energy) secs to x: (computerX) y: (computerY)
repeat until <<(energy) < [10]> or <(bored) = [true]>>
if <(struggle) = [true]> then
say [help me please]
else
code
end
end
- Igor-Gaming
- Scratcher
71 posts
Better physics
Based on recent discussions clones can receive broadcasts. You can use broadcasts to send data to other clones, but it might be better to just go off of variables and lists. You might want to make a list which will store the ID for the specific clone. Then you can grab data from the list when a certain clone needs to preform an action. I still have trouble thinking about it, because I need clones to communicate to each other somehow, which I cannot grasp.
Welcome to the Velvet Room
- 640257SH
- Scratcher
27 posts
Better physics
I still have trouble thinking about it, because I rarely use lists. I don't know much about them either. If there are any simple games that use them and might help me understand please tell me about them!
when I receive [scratch time v]
glide (energy) secs to x: (computerX) y: (computerY)
repeat until <<(energy) < [10]> or <(bored) = [true]>>
if <(struggle) = [true]> then
say [help me please]
else
code
end
end
- Discussion Forums
- » Help with Scripts
- » Better physics