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

#1 2011-08-09 18:03:01

zxz1661
Scratcher
Registered: 2010-01-06
Posts: 52

Need help with circle collision?

How could i manage to get a perfect ball collision with two sprites with velocities (x and y)? I know it has some combination of cos/sin,but i cant quite figure it out. I have done this before but i can't seem to do it again.

Thanks in advance!

Offline

 

#2 2011-08-11 01:58:47

slayerrobe7
Scratcher
Registered: 2011-06-24
Posts: 500+

Re: Need help with circle collision?

<when green flag clicked>
<forever>
<if>
<touching[  Sprite
<turn cw( 180 )degrees>
<point in direction( (( 0 <-> <direction> ))


!!!When it comes to Scratch2.0 I am totally like freaking out!!!

Offline

 

#3 2011-08-11 04:20:26

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

Re: Need help with circle collision?

slayerrobe7 wrote:

[blocks]<when green flag clicked>
<forever>
<if>
<touching[  Sprite
<turn cw( 180 )degrees>
<point in direction( (( 0 <-> <direction> ))[/blocks]

Nice try, but I think zxz meant something slightly more complicated.

I never actually attempted perfect collisions, but I've seen many projects that use them. You could try searching for them... I'd do it for you but I'm temporarily lazy  tongue

Offline

 

#4 2011-08-11 04:27:31

Qwiffles
Scratcher
Registered: 2011-07-13
Posts: 100+

Re: Need help with circle collision?

LS97 wrote:

slayerrobe7 wrote:

[blocks]<when green flag clicked>
<forever>
<if>
<touching[  Sprite
<turn cw( 180 )degrees>
<point in direction( (( 0 <-> <direction> ))[/blocks]

Nice try, but I think zxz meant something slightly more complicated.

I never actually attempted perfect collisions, but I've seen many projects that use them. You could try searching for them... I'd do it for you but I'm temporarily lazy  tongue

How can you be temporarily lazy?


Don't feed a pet troll.  It will turn evil.

Offline

 

#5 2011-08-11 04:28:45

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

Re: Need help with circle collision?

Qwiffles wrote:

LS97 wrote:

slayerrobe7 wrote:

[blocks]<when green flag clicked>
<forever>
<if>
<touching[  Sprite
<turn cw( 180 )degrees>
<point in direction( (( 0 <-> <direction> ))[/blocks]

Nice try, but I think zxz meant something slightly more complicated.

I never actually attempted perfect collisions, but I've seen many projects that use them. You could try searching for them... I'd do it for you but I'm temporarily lazy  tongue

How can you be temporarily lazy?

Right now, I'm lazy. Maybe in an hour I'll be screaming to get out of bed.

Offline

 

Board footer