Player > Draw Actor
- Code: Select all
char * key = GetKeyState();
float tspeed=0;
char anim[32];
if(vdir==0){vdir=1;}
if(key[KEY_RIGHT]==1){
hdir=0;
if(vdir>0)
tspeed=speed;
}
if(key[KEY_LEFT]==1){
hdir=1;
if(vdir>0)
tspeed=-speed;
}
if(key[KEY_SPACE]==1 && vdir!=1){
yvelocity=jump*canjump;
canjump=0;
}
if(key[KEY_LSHIFT]==1){
dash=2;
tspeed*=dash;
}
if(key[KEY_DOWN]==1){
if(vdir<2)
vdir=0;
tspeed=0;
}
else if(vdir==2){
vdir=0;
tspeed=speed;
}
x+=tspeed;
yvelocity+=1;
if(yvelocity>2 && canjump==1){
canjump=0;
vdir=2;
}
Player > Collision
- Code: Select all
PhysicalResponse(MOVE_EVENT_ACTOR_ONLY, USE_CALCULATED_MASS, 1,1,0,1);
canjump=1;
if(vdir==2){
vdir=1;
}
Player > Create Actor
- Code: Select all
speed=4;
hdir=0;
vdir=1;
jump=-12;
canjump=0;
dash=1;
If anyone could provide a little insight to why my Actor isn't jumping, I'd be very grateful.