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

#1 2008-04-20 11:59:21

DoctorB
Scratcher
Registered: 2008-04-20
Posts: 18

Collison Detection

Thanks for the reply, what i mean is like if a sprite bumps into a wall it doesn't go through it or just slightly bounces off, i'm doing a huge Zelda game, a month in progress so far, and when link bumps into a wall he needs to stay put or just slightly bounce from it!

Last edited by DoctorB (2008-04-20 12:46:05)


If there are any exquisite or VERY POWERFULL Super Smash Brothers Brawl players out there, tell me your brawl & wii code and try to beat me, i've versed many people and won, i would like a challange, i'll get my brawl & wii code back to here, just check every now and then!!! :-)

Offline

 

#2 2008-04-20 12:43:01

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: Collison Detection

I guess it depends on what you mean by collision detection.  Scratch has the built in "Touching xxx" block (where xxx is a sprite name) under the sensing tab.  That works for a lot of situations; just make what you want to avoid a sprite.  If you want to avoid collisions with the background then you need to get into color sensing.  I've seens some very sophisticated systems used on some of the platform games with a separate invisible sprite using color sensing used to avoid walls and such. 

Maybe if you can be a bit more specific about what your application is, I (and others) can recommend some good sample projects.


http://i39.tinypic.com/2nav6o7.gif

Offline

 

#3 2008-04-20 12:53:05

likegames
Scratcher
Registered: 2008-03-24
Posts: 100+

Re: Collison Detection

coloUr sensi ng


There are 10 types of people in this world: Those who understand trinary, those who don't, and those who think this is the same old signature.
Three lines! (and base three!)

Offline

 

#4 2008-04-20 12:53:25

Bluestribute
Scratcher
Registered: 2008-01-24
Posts: 1000+

Re: Collison Detection

You could put that if it's touching a sprite or color, it moves its x or y by 2, or -2. Look at my game Ninja Panda Collision Practie, download, and see what I mean (i thik i used 10)


http://img247.imageshack.us/img247/1204/bluestributett4.jpg
That's my PSN ID. I know tons of COD4 glitches. Add me as your friend. Oh, and get a headset

Offline

 

#5 2008-04-20 12:56:10

DoctorB
Scratcher
Registered: 2008-04-20
Posts: 18

Re: Collison Detection

Thanks ill try it


If there are any exquisite or VERY POWERFULL Super Smash Brothers Brawl players out there, tell me your brawl & wii code and try to beat me, i've versed many people and won, i would like a challange, i'll get my brawl & wii code back to here, just check every now and then!!! :-)

Offline

 

Board footer