Ok, I'm currently working on some things frequently seen in pinball games
First, a bouncer (like, on touch it bounces you(phent ball) away.
Right now, the bouncer entity (a sphere, placeholder) rotates so that its facing the player on impact but I just cant get the actual push to work correctly >_<
Code:
function event_bounce()
{
if (event_type == EVENT_IMPACT )
{
vec_set(temp,player.x);
vec_sub(temp,my.x);
vec_to_angle(my.pan,temp);
phent_clearvelocity(player);
// this part isnt working right :((
//phent_addvelcentral (player,my.pan ); //schieben
phent_addvelcentral (player, vector(my.pan, 0, 0)); //schieben
return;
}
}
I messed with that for quite some time and I can somehow get it to bounce the player away but the direction it pushes the player to is always [censored] up and never quite right
So now for my second problem
I want to make a function/event that, when the player collides with another phent (another ball in this case) creates a force at the exact impact location so it pushes both balls away. I was thinking about scanning for the nearest vertex where the impact happened but I have no real idea how exactly I should do this :s
Any kind of help or hint would be appreciated
Merry Xmas
- Ready