so every game i make i try to make a jump code, unfortunately i don't know how to make a limit (in truth i do but its only if the character's _y value is always starting in one spot)
SHOULD THIS go in the sprites (or another action script file attached to a class) or the frame actions?
no i only know AS2 so far
needs gravity i beleive
why has this post been revived?
Ahmm? yeah, why is this revived.And yeah, you need gravity(in case Koshionis is still waiting)
I can give you a script later its on my laptop.
//AS2 codevar vy:Number=0;hero.onEnterFrame=loop;function loop(){ var landed:Boolean=false; //gravity vy+=1; if(vy>10){ vy=10; } if(platforms.hitTest(hero._x, hero._y, true)){ landed=true; vy=0; //move you out of the ground while(platforms.hitTest(hero._x, hero._y-1, true)){ hero._y--; } } //jumping if(isKeyDown(38)&&landed){ vy-=10; } //moving this._y+=vy;}
Thread is locked!