nearly there but... stairs grrr

Non-platform specific questions.

Re: nearly there but... stairs grrr

Postby foleyjo » Fri Jun 24, 2011 7:03 pm

I'm still not getting this.

I've tried different things but still can't get it to move like I need it

I have managed to make him walk left and right
jump up
jump diagnol
fall straight
and walk down stairs

but can't get him walking up the stairs.

The code I'm using now is
Collision Top Of Tiles (repeat while colliding) (also used on steps)
Code: Select all
char* key = GetKeyState();
if (yvelocity >= 0)
{  PhysicalResponse(MOVE_EVENT_ACTOR_ONLY, USE_CALCULATED_MASS, 1.000000, 1.000000, 0.000000, 1.000000);
  xspeed = (key[KEY_RIGHT] - key[KEY_LEFT]) * 8;
 // x += xspeed;
  JumpReady = TRUE;
}


Draw Actor
Code: Select all
char* key = GetKeyState();

if (yvelocity <13)
  yvelocity++;

if (JumpReady && key[KEY_SPACE])
{  yvelocity= -15;
 xspeed = (key[KEY_RIGHT]- key[KEY_LEFT]) *5;
 JumpReady = FALSE;
}
  x+= xspeed;


Collision Finish (Tiles)
Code: Select all
if (JumpReady)
  xspeed = 0;

JumpReady = FALSE;
KISS -Keep It Simple Stoopid
foleyjo
 
Posts: 275
Joined: Mon Jul 09, 2007 1:15 pm
Score: 15 Give a positive score

Previous

Return to General

Who is online

Users browsing this forum: No registered users and 1 guest