Could someone tell me what the other half of the block specs for a [When thouching %m , bounce] would be? It's like [if on edge, bounce]. I'm gonna try to do the instance on my own, so please don't post that (if there is one needed) unless I ask. Thanks in advance.
-majormax
P.S. Feel free to use this in a mod, just give me credit.
Offline
henley wrote:
Why not just make a [bounce] block?
That would work... but all it is a turn 180 degrees I think.
Offline
markyparky56 wrote:
henley wrote:
Why not just make a [bounce] block?
That would work... but all it is a turn 180 degrees I think.
Actually, I think it would be turn 90 (or -90).
Offline
majormax wrote:
markyparky56 wrote:
henley wrote:
Why not just make a [bounce] block?
That would work... but all it is a turn 180 degrees I think.
Actually, I think it would be turn 90 (or -90).
Maybe... actually yeah, if you look at what light does when it hits a reflective surface at an angle of 45 degrees, if bounces off at 45 degrees, so it is 90 degrees (or -90)
Offline
I'm not that good ant angles. That was kinda a estimated guess. I actually think climber59 is right.
Offline
I think they should get rid of the [if on edge, bounce] block. You can do the same thing with:
[if <touching [edge]>]
[point in direction ( (180 - (direction) )]
[end if]
okay, back on topic:
so, say you name your instance 'touching:bounce.' Then the blockspec would look like ('if touching %m bounce' #- #touching:bounce)
There ya go!
Offline
Okay, I tried to do the instance, but failed.
Offline
(that means help with the instance)
Offline
climber59 wrote:
But if it hits at 30 degrees it bounces off at 30 degrees which is 120 not 90.
Yeah... good point, I geuss its a whole load of maths to be worked out.
Offline
reflecting off a surface is simply a matter of finding the angle between the motion vector of the object and the line perpendicular to the surface, then reflecting that along the same line.
Offline
if you know the shape of the object you are colliding with and the direction to that object from the object doing the colliding, you should be able to get it to bounce off. I believe the most popular method is probably using slightly different colours for different sides of any object on the stage so the object knows how to bounce.
Offline
sparks wrote:
if you know the shape of the object you are colliding with and the direction to that object from the object doing the colliding, you should be able to get it to bounce off. I believe the most popular method is probably using slightly different colours for different sides of any object on the stage so the object knows how to bounce.
or use a mask sprite (although I don't think any mod will actually allow you to do this yet. Someone should make a custom "pixel x:() y:() is within sprite [ v]" block)
EDIT: Oh jeez, that block looks like a bunch of unhappy faces >.>
Last edited by nXIII (2010-07-07 19:38:32)
Offline