Page 1 of 1

Physics Issues

PostPosted: Sun Mar 22, 2009 9:36 pm
by Hedfone
I'm making a platformer and before i get too involved with it i wanted to clear up a couple basic problems i've been having with the physics.

The first one is that if if my character jumps and hits a wall, he just sticks there as long as the arrow key is held down.
The second problem is that sometimes while stationary, if the player is too close to the edge of the platfom (even though it's completely horizontal) He'll just start to slide off of it, one pixel at a time.

Does anyone know how to fix this? Seriously annoying...

Re: Physics Issues

PostPosted: Sun Mar 22, 2009 11:51 pm
by jimmynewguy
for the wall sticking just have collision on left or right side of wall ~~ yvelocity += 1;
or what ever you use for gravity, and for the sliding thing you can make a actor called "player real" thats a box to make collisions smooth then just have the player with all the images follow him, if you don't get it i think there is a demo for collisions......http://game-editor.com/forum/viewtopic.php?f=5&t=5826 found it (DST thanx) :lol:

Re: Physics Issues

PostPosted: Sun Mar 22, 2009 11:53 pm
by BlarghNRawr
the wall sticking is fixed by putting in your gravity code (probably yvelocity=yvelocity+5) in for the collision on left or right side of wall

and the other problem i fix by putting the VERY side of platforms 1 pxl higher :)

Re: Physics Issues

PostPosted: Mon Mar 23, 2009 2:00 am
by DST
Use pyro's wallside fix for best collisions. Disregard the perfect collision demo. Its too much work.

Collision>left or right side of wall>

Code: Select all
int j=yvelocity;
PhysicalResponse(MOVE_EVENT_ACTOR_ONLY, USE_CALCULATED_MASS, 1, 1, 0, 1);
yvelocity=j;



this works better than anything else so far.

Re: Physics Issues

PostPosted: Mon Mar 23, 2009 3:32 am
by pyrometal
DST wrote:Use pyro's wallside fix for best collisions.


lol, I've become popular! Since the PhysicalResponse() function is uncustomizable, you sometimes have to work around it slightly... I wish this was not the case but these work arounds are a lot less work than creating your own collision script (which I've done before at the cost of several headaches and days of work...)

Re: Physics Issues

PostPosted: Tue Mar 24, 2009 10:17 pm
by Hedfone
BlarghNRawr wrote:
and the other problem i fix by putting the VERY side of platforms 1 pxl higher :)


Sorry, what do you mean?


ps: thanks to everyone! I really appreciate your help :)

Re: Physics Issues

PostPosted: Wed Mar 25, 2009 8:54 pm
by BlarghNRawr
picture shows how...
example.PNG
look closely


if you dont want to see the extra pxl, make it a different actor with the same properties, and change its visibility state to "dont draw but allow events" tis wont work if you have a flat char standing right ontop of the pixel, but its the closest ive gotten to fixing the problem... :)