Thanks for the help. I am using saveVars for now to save variables for all my keys and chests... later on i will hopefully put these into arrays.
So my new problem is severe lag when I test on the iPhone. The first time I tested using seperate files on iPhone worked great. But this time its really laggy. The file sizes arent very big at all yet (68 kb and 78 kb for GED) (700 kb and 570 kb for exported .dat files)
I am wondering if something I am coding is causing some lag. Perhaps since I moved alot of my character movement code to the character draw actor.
- Code: Select all
//Slow Fall
if (slowFall ==1)
{yvelocity = 2.5;
canjump =0;
if (faceLeft ==1)
{ChangeAnimation("Event Actor", "Jump_left", FORWARD);}
else
{ChangeAnimation("Event Actor", "Jump_right", FORWARD);}
}
//Gravity
if (yvelocity<10)
{yvelocity = yvelocity + 0.7;}
if (yvelocity<20)
{yvelocity = yvelocity + 0.3;}
//Walking
if (goRight ==1)
{
x= x + 10;
faceLeft =0;
if (slowFall==0 || oG==1 || oG2==1 || oG3==1 || oG4==1 && yvelocity>1)
{ChangeAnimation("Player", "Walk_Right", FORWARD);}
}
if (goLeft ==1)
{
x= x - 10;
faceLeft =1;
if (slowFall==0 || oG==1 || oG2==1 || oG3==1 || oG4==1 && yvelocity>1)
{ChangeAnimation("Player", "Walk_Left", FORWARD);}
}
//Jumping
if(AButtonPress==1 && canjump>0)
{
yvelocity= yvelocity -14;
canjump--;
if (faceLeft ==1)
{ChangeAnimation("Event Actor", "Jump_left", FORWARD);}
else
{ChangeAnimation("Event Actor", "Jump_right", FORWARD);}
}
if (AButtonPress ==1)
{
if (yvelocity >= 2.5)
{
slowFall =1;
}
}
//Idle
if (AButtonPress ==0 && goRight ==0 && goLeft==0)
{
if (faceLeft ==1)
{ChangeAnimation("Event Actor", "Idle_left", FORWARD);}
else
{ChangeAnimation("Event Actor", "Idle_right", FORWARD);}
slowFall=0;
}
//Death
if (playerDeath ==1)
{
if(fadeBlack.transp>0)
{
fadeBlack.transp-=0.08;
}
}
if(fadeBlack.transp<=0)
{
playerDeath =0;
if (startLocation ==0)
{ MoveTo("Player", 0.000000, 0.000000, 100000.000000, "startLocation0", "");}
if (startLocation ==1)
{ MoveTo("Player", 0.000000, 0.000000, 100000.000000, "startLocation1", "");}
if (startLocation ==2)
{ MoveTo("Player", 0.000000, 0.000000, 100000.000000, "startLocation2", "");}
if (startLocation ==3)
{ MoveTo("Player", 0.000000, 0.000000, 100000.000000, "startLocation3", "");}
if (startLocation ==4)
{ MoveTo("Player", 0.000000, 0.000000, 100000.000000, "startLocation4", "");}
}
if (playerDeath ==0)
{
if(fadeBlack.transp<1)
{ fadeBlack.transp+=0.08;
}
}
if (playerFaint ==1)
{ startLocation =0;
saveVars ("data.sav", "data");
LoadGame("AngerTower");
playerFaint =0; }
And along with that I have dialog information stored in the draw actors of other characters.
Its either that or the lag is happening due to my .sav files now. Those are the two big changes I made.
No lag in the Game Mode in the editor. Please If anyone has any idea of what It could be, I would really appreciate the help!