Death Codes:
Enemy Collision:
- Code: Select all
DEAD=1;
PlaySound2("data/down a heart.wav", 1.000000, 1, 0.000000);
When fallen pass the view code:
- Code: Select all
DEAD=1;
yvelocity=0;
PlaySound2("data/down a heart.wav", 1.000000, 1, 0.000000);
SO uh WTH the yvelocity=0 code was an attempt to fix the gltich..... but no it didnt do anything. Heres the code that executes in draw actor once the "DEAD" variable = 1
- Code: Select all
if (DEAD==1) {
transp=.99;
yvelocity=0;
CreateTimer("Event Actor", "respawn", 1000);
}
So why does my character jump? heres the Create Timer code
- Code: Select all
if (LIVES>0) {
LIVES-=1;
x=SPAWN[0];
y=SPAWN[1];
DEAD=0;
yvelocity=0;
DestroyTimer("respawn");
view.x=-320;
transp=0; }
if (LIVES==0) {
LoadGame(""); }
Total Draw Actor Code:
- Code: Select all
GetPad(10000, 10000); GetKeys(); SetGravity(.4);
DoGravity();
if (DEAD==0) {
if (animindex==1 || animindex== 3 || animindex == 4) {
dir=0; }
if (animindex==0 || animindex==2 || animindex==5) {
dir=1; }
if (yscreen>=480) {
yvelocity=0;
DEAD=1;
PlaySound2("data/down a heart.wav", 1.000000, 1, 0.000000); }
if (xscreen<620) {
if (GORIGHT) {
x+=3;
if (temp[1]==0) {
ChangeAnimation("Event Actor", "RunRight", NO_CHANGE); }
if (temp[1]==1) {
ChangeAnimation("Event Actor", "JumpRight", NO_CHANGE); }
}
}
if (xscreen>20) {
if (GOLEFT) {
x-=3;
if (temp[1]==0) {
ChangeAnimation("Event Actor", "RunLeft", NO_CHANGE); }
if (temp[1]==1) {
ChangeAnimation("Event Actor", "JumpLeft", NO_CHANGE); }
}
}
if (KEYRIGHT==1 && KEYLEFT==1) {
if (animindex==0 || animindex==5) {
ChangeAnimation("Event Actor", "StopLeft", NO_CHANGE); }
if (animindex==1 || animindex==4) {
ChangeAnimation("Event Actor", "StopRight", NO_CHANGE); }
}
if ((LXAXIS<los && LXAXIS>-los) && KEYLEFT==0 && KEYRIGHT==0) {
if (animindex==0 || animindex==5) {
ChangeAnimation("Event Actor", "StopLeft", NO_CHANGE); }
if (animindex==1 || animindex==4) {
ChangeAnimation("Event Actor", "StopRight", NO_CHANGE); }
}
if (xscreen>325) {
view.x+=3; }
if (xscreen<315 && view.x>-317) {
view.x-=3; }
if (xscreen<=20) { SSSS=1; }
if (xscreen>=620) { SSSS=1; }
if (SSSS==1 || VARS[1999]==1 && temp[1]==0) {
if (animindex==0 || animindex==5) {
ChangeAnimation("Event Actor", "StopLeft", NO_CHANGE); }
if (animindex==1 || animindex==4) {
ChangeAnimation("Event Actor", "StopRight", NO_CHANGE); }
}
if (APRESS && temp[0]==0 && temp[1]==0) {
temp[0]=1;
yvelocity=-10;
temp[1]=1; }
if (xscreen>20 && xscreen<620) {
SSSS=0; }
if (yvelocity>2) {
temp[0]=1;
temp[1]=1; }
if (yvelocity>-1 && yvelocity<1) {
temp[1]=0;
}
if (XPRESS && temp[2]==0) {
temp[2]=1;
PlaySound2("data/SILLYPOP.WAV", 1.000000, 1, 0.000000);
CreateActor("bombs", "bomb01", "(none)", "(none)", 0, 0, false);
}
if (KEYX==0 && JoyX==0) {
temp[2]=0; }
}
if (DEAD==1) {
transp=.99;
yvelocity=0;
CreateTimer("Event Actor", "respawn", 1000);
}
I hate glitches like this they dont make the least bit of freaking sense it's so frustrating!