Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Collision engine
- Caiden2000
- Scratcher
41 posts
Collision engine
Dunno really what to call it though. So, I have a sprite which is a ball with 4 lines coming out of it in all directions. I have this script to simulate gravity
( http://prntscr.com/4aho25 ). How would I make it so multiple instances can climb over each other instead of going through each other?
Basically, how do I predict where the sprite should move when he's touching another instance of the sprite?
I hope I get an answer :I
( http://prntscr.com/4aho25 ). How would I make it so multiple instances can climb over each other instead of going through each other?
Basically, how do I predict where the sprite should move when he's touching another instance of the sprite?
I hope I get an answer :I
when green flag clicked
forever
if <(Help) = [helpful] > then
broadcast [Thank you so much! :)]
set (Gratitude) to [10]
end
end
- Greatguy123
- Scratcher
500+ posts
Collision engine
Ok, let's see…so you want the balls to bump in to each other?
The evil if block is hungry! >:-D
- Caiden2000
- Scratcher
41 posts
Collision engine
Sorry, let me post the entire thing
http://scratch.mit.edu/projects/25402142/
The thing is, you could fake it if you had just balls, because that's pretty much a linear surface, consistent. But these balls have lines coming out of them. I don't know how I would deal with that. Figuring out exactly what part of the sprite is being touched? Pixel by pixel? And what would I DO with that information? How?
http://scratch.mit.edu/projects/25402142/
The thing is, you could fake it if you had just balls, because that's pretty much a linear surface, consistent. But these balls have lines coming out of them. I don't know how I would deal with that. Figuring out exactly what part of the sprite is being touched? Pixel by pixel? And what would I DO with that information? How?
Last edited by Caiden2000 (Aug. 8, 2014 00:26:17)
when green flag clicked
forever
if <(Help) = [helpful] > then
broadcast [Thank you so much! :)]
set (Gratitude) to [10]
end
end
- Greatguy123
- Scratcher
500+ posts
Collision engine
Oh. Eesh. How long have you been using Scratch?
The evil if block is hungry! >:-D
- Discussion Forums
- » Help with Scripts
- » Collision engine