Here ya go peedalein
http://www.megaupload.com/?d=CA7AUO4DNow I haven't actually tested it on the iphone, But I used the same method that I am using in my current iphone game, and it works just fine for me.
What I did was create three actors; PlayerCollision, PlayerGround, PlayerJump.
I set PlayerCollision to be the Parent of both PlayerGround and PlayerJump. Whenever you player leaves the "Ground" you will have
this code:
JumpButton-> MouseButtonDown->ScriptEditor->
- Code: Select all
if(JUMP==1)
{
PlayerCollision.yvelocity=-12;
JUMP=0;
ChangeTransparency("PlayerGround", 1.000000);
ChangeTransparency("PlayerJump", 0.000000);
}
and Use this code in;
PlayerCollision->AddEvent->Collision->TopSideOfGround->ScriptEditor->
- Code: Select all
ChangeTransparency("PlayerGround", 0.000000);
ChangeTransparency("PlayerJump", 1.000000);
remember to add all of your Players Jump Animations to the "PlayerJump" actor, and the Running Animations to your "PlayerGround" actor.
you should be able to figure out the rest
I know this method is not the best, but as long as you use all of your collision events on the PlayerCollision actor, You should be set!
if you have anymore questions, feel free to ask