ok… I’m working on the pinball game. I need to come up with a way of retreiving the right angle from an curved line.
The idea is to have the ball follow a curve around the upper border of the game field. The ball itself is going to be a point, which the ball follows, so that I can use the shape of the object when doing hit detection. I’m not sure if that’s relivant to the subject or not… but it gives some idea of where I’m going with this.
haha… I TOLD YOU… you’re going to need to know the equation for the curve…
maybe if you draw it in actionscript, kinda like lost’s besier curve thing on his site, you can figure out the equation from there…
but in order to get the normal, you need to find out the tangent of the curve…
BUT to make a pinball game, you don’t NEED to do a curve… have you played the altoids one? I think they ran into that same problem too, and decide to do away with curved surfaces
I was also thinking the same thing as you… that ploting out the points in a list or arrray, which coincide with the actual curve… might be the way to go. I’m not quite ready to go to that extreme yet… but maybe soon.
well… lets think about how we might have calculated this in pre-newtonian times…
if you have an irregular curve, you could have some hidden straight lines, like 4 or 5, that follow the contour of the curve. You would definitely be able to set the angular response to those… and the ball would simulate to a degree the path it would take along that curve.
I dont think you need to go as far as the pixel on this.
I think what that FLA is doing is determining where in the contour the ball hits, and hten checking where the coordinates of the surrounding pixels are… then it determines the normal from there…
but I dont think you need to go into that much detail… I think if you’re doing an irregular surface (not as irregular as the ones in the example) you should be ok with 4 or 5 invisible lines…
ehh… I’m not so sure about that. In the case of a pinball… we want it to run up a vertical and then bend as it reaches the arc. That’s not going to be accomplished by invisible lines.
But David, you also have to think about this… the ball is only going to pass through that area less than 5% of the time (by my estimate…) is a behavior that requires so many hit tests per area necessary?
well the ball really only has one behavior. And probebly there will never be more than 5 balls in play no matter what game you make. I don’t think that the hit tests will be nearly as slugging to the system as you think they are going to be.
and how may hit tests. It’s one per ball, per frame… and possibly only every other frame. Am I thinking about that incorrectly?