Page 1 of 1

Changing the physical responce action to suit isometric game

PostPosted: Sat Dec 23, 2006 4:19 pm
by Novice
This is a question for makslane but if anyone can help out I would be grateful.

I'm making an isometric game and i noticed that when you try to bounce a ball of an angled wall it doesn't behave as you would expect looking from an isometric view, which of course is what should happen because GE is programed like that.
My question is how can I create a function that will use physical response but with an angle offset, the picture explains everything better.

I tried making this myself but it works only on one side of an actor and is a bit buggy.

PostPosted: Sun Dec 24, 2006 1:20 pm
by makslane
May be you can change the gravity direction to try get the effect, by using a little value to change the xvelocity, not only the yvelocity.

PostPosted: Sun Dec 24, 2006 2:53 pm
by Novice
I tried a lot more and it looks like GE doesn't cope well with angled refractions with the standard physical response, one time the actor flies in one direction and other time the actor files in a totally different direction. I think it's because it works on pixels instead of vectors, so it's hard to get the correct angle.

I will do this manually and calculate per angle basis, I think it will work even better this way. I will post what I managed to do.

Thanks for the advice makslane.

PostPosted: Sun Dec 24, 2006 5:33 pm
by Fuzzy
I am guessing that the angle that it reflects at varies by where along the slope it hits, but it is consistant at any point of the slope?

PostPosted: Mon Dec 25, 2006 12:15 am
by Novice
Thanks for trying but I figured it out, all it took were a few if statements (depending from which direction the ball is coming) and some modified refractional formulas and it works like a charm now, even better than I hoped. Now realistic game play is possible. :D
If anyone is interested I'll post the code.

PostPosted: Mon Dec 25, 2006 12:16 am
by Hedfone
:D im interested.....

PostPosted: Mon Dec 25, 2006 4:22 am
by Fuzzy
Please post the code! I am interested.[/quote]

PostPosted: Mon Dec 25, 2006 6:51 pm
by Game A Gogo
*snors*
...ummm...*slups*...<.< >.>
I too wanna know!

PostPosted: Mon Dec 25, 2006 7:41 pm
by Novice
Code: Select all
if (angle>205&&angle<335)
angle=335+round((335-angle)/2.6);
else if (angle<206&&angle>155)
angle=25+round((205-angle)*2.6);

This code is just for the example shown above, you have to modify it for other directions to works. I busted my head for two days so I'm not going to hand it all to you "out of the box ready", work those brain muscles a little :wink: