- Code: Select all
if (stopped == 1)
{
switch(animindex)
{
case 0:
ChangeAnim(Bleh...);
}
}
And so on from there
It might work And it could look professional in gameplay wise It'll also save from typing zillions of lines of code lol
if (stopped == 1)
{
switch(animindex)
{
case 0:
ChangeAnim(Bleh...);
}
}
if(animindex==0)
{
x+=5;
}
char*key=GetKeyState();
if(key[KEY_LEFT]==1&&key[KEY_RIGHT]==0)
{
changeanim
x-=4;
}
else if(key[KEY_LEFT]==1&&key[KEY_RIGHT]==1)
{
changeanimdirection(STOPPED); //replace with changeanim if you have a stopped animation o:
}
else if(key[KEY_LEFT]==0&&key[KEY_RIGHT]==1)
{
changeanim
x+=4;
}
else if(key[KEY_LEFT]==0&&key[KEY_RIGHT]==0)
{
changeanimdirection(STOPPED); //replace with changeanim if you have a stopped animation o:
}
kdir = kr - kl;
x += kdir * 5;
int dir; //-1:left, 1:right
int walk; //0:stop, 1:walk
char DirTxt[4][32]=
{
"Left","Nothing","Right",
};
char WalkTxt[3][32]=
{
"Stop","Walk",
};
char animname[32];
sprintf(animname,"Player%s%s",DirTxt[dir+1],WalkTxt[walk]);
ChangeAnimation("Event Actor", animname, NO_CHANGE);
char*key=GetKeyState();
x+=(key[KEY_RIGHT]-key[KEY_LEFT])*5;
Game A Gogo wrote:don't forget the:
- Code: Select all
char*key=GetKeyState();
x+=(key[KEY_RIGHT]-key[KEY_LEFT])*5;
x+=dir*speed*walk;
Users browsing this forum: No registered users and 1 guest