Changing the physical responce action to suit isometric game

You must understand the Game Editor concepts, before post here.

Changing the physical responce action to suit isometric game

Postby Novice » Sat Dec 23, 2006 4:19 pm

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.
Attachments
trajectory.png
A- shows what happens
B- shows what should happen
The red line shows the angle over which the ball refracts.
Why do i always get stuck?
User avatar
Novice
 
Posts: 399
Joined: Mon Aug 29, 2005 10:54 am
Location: Relative
Score: 5 Give a positive score

Postby makslane » Sun Dec 24, 2006 1:20 pm

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.
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby Novice » Sun Dec 24, 2006 2:53 pm

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.
Why do i always get stuck?
User avatar
Novice
 
Posts: 399
Joined: Mon Aug 29, 2005 10:54 am
Location: Relative
Score: 5 Give a positive score

Postby Fuzzy » Sun Dec 24, 2006 5:33 pm

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?
Mortal Enemy of IF....THEN(and Inspector Gadget)

Still ThreeFingerPete to tekdino
User avatar
Fuzzy
 
Posts: 1068
Joined: Thu Mar 03, 2005 9:32 am
Location: Plymostic Programmer
Score: 95 Give a positive score

Postby Novice » Mon Dec 25, 2006 12:15 am

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.
Why do i always get stuck?
User avatar
Novice
 
Posts: 399
Joined: Mon Aug 29, 2005 10:54 am
Location: Relative
Score: 5 Give a positive score

Postby Hedfone » Mon Dec 25, 2006 12:16 am

:D im interested.....
User avatar
Hedfone
 
Posts: 174
Joined: Mon Jul 31, 2006 9:47 pm
Score: 2 Give a positive score

Postby Fuzzy » Mon Dec 25, 2006 4:22 am

Please post the code! I am interested.[/quote]
Mortal Enemy of IF....THEN(and Inspector Gadget)

Still ThreeFingerPete to tekdino
User avatar
Fuzzy
 
Posts: 1068
Joined: Thu Mar 03, 2005 9:32 am
Location: Plymostic Programmer
Score: 95 Give a positive score

Postby Game A Gogo » Mon Dec 25, 2006 6:51 pm

*snors*
...ummm...*slups*...<.< >.>
I too wanna know!
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Postby Novice » Mon Dec 25, 2006 7:41 pm

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:
Why do i always get stuck?
User avatar
Novice
 
Posts: 399
Joined: Mon Aug 29, 2005 10:54 am
Location: Relative
Score: 5 Give a positive score


Return to Advanced Topics

Who is online

Users browsing this forum: No registered users and 1 guest