Physical response problem

Game Editor comments and discussion.

Physical response problem

Postby BogdansB » Mon Dec 05, 2011 4:55 pm

hey,
I was making a game where a player and a wall is. i made a physical response to them with no bouncing.
when th eplayer jumps (left) on the walls side, he stays on the side without moving, when you press "left" . when you stop to press he falls.

how can i change it so, that he doesn't stuck on the side and just slides down.
BogdansB
 
Posts: 94
Joined: Tue Oct 25, 2011 2:30 pm
Score: 0 Give a positive score

Re: Physical response problem

Postby jimmynewguy » Mon Dec 05, 2011 5:08 pm

Use this basic method made be pyro for collsions, it's simple and works pretty well. Use velocities for movement instead of just moving the coordinates (ie. no x+=1; or x = x +1;)
Collision->top side->ground->with repeat yes
Code: Select all
double mem = xvelocity;\\holds the current xvelocity
if(yvelocity >= 0)//if your falling
{
PhysicalResponse(MOVE_EVENT_ACTOR_ONLY, USE_CALCULATED_MASS, 1.000000,1.000000, 0.000000, 1.000000);
xvelocity = mem;//reset the xvelocity so you don't glitch up
jump=1;//reset jump variable
}

Collision->bottom side->ground->with repeat yes
Code: Select all
double mem = xvelocity;
if(yvelocity < 0)//check if moving up
{
PhysicalResponse(MOVE_EVENT_ACTOR_ONLY, USE_CALCULATED_MASS, 1.000000,1.000000, 0.000000, 1.000000);
xvelocity = mem;
}

Collision->left or right side->ground->with repeat yes
Code: Select all
double mem = yvelocity;
PhysicalResponse(MOVE_EVENT_ACTOR_ONLY, USE_CALCULATED_MASS, 1.000000,1.000000, 0.000000, 1.000000);
yvelocity = mem;
Working on a probably too ambitious project! Wild-west-adventure-RPG-shooter-thing.
User avatar
jimmynewguy
 
Posts: 1137
Joined: Sat Mar 31, 2007 6:27 pm
Score: 89 Give a positive score

Re: Physical response problem

Postby BogdansB » Mon Dec 05, 2011 6:55 pm

thank you very much, it works :D
BogdansB
 
Posts: 94
Joined: Tue Oct 25, 2011 2:30 pm
Score: 0 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest