توی این آموزش راه رفتن نشستن پریدن را آموزش میدهم .
[آپارات فقط 5 کلمه آخری]oydjv[/آپارات فقط 5 کلمه آخری]
در آموزش به این دقت کنید
این هم کد ها
stop();
var grav:Number = 0;
var gravity:Number = 5; //strength of gravity
var speed:Number = 15; //speed player moves
var maxJump:Number = -50; //hight before falling back to ground
var flyHeight:Number = -20;
var touchingGround:Boolean = false; //if player is on ground or not
function onEnterFrame() {
//gravity code
char._y += grav;
grav += gravity;
while (ground.hitTest(char._x, char._y, true)) {
char._y -= gravity;
grav = 0;
}if (ground.hitTest(char._x, char._y+5, true)) {
touchingGround = true;
} else {
touchingGround = false;
}if(char._y <= 0){
char._y += 60;
//player controls
}else if (Key.isDown(Key.UP) && touchingGround) {
grav = maxJump;
}else if(Key.isDown(Key.LEFT)){
char._x-=speed;
cameraUpdate();
char.gotoAndStop(2);
char._xscale = -100;
}else if(Key.isDown(Key.RIGHT)){
char._x+=speed;
cameraUpdate();
char.gotoAndStop(2);
char._xscale = 100;
}else if(Key.isDown(Key.RIGHT)){
char._x+=speed;
cameraUpdate();
char.gotoAndStop(3);
char._xscale = 100;
}else if(Key.isDown(65)){
char._x+=speed;
cameraUpdate();
char.gotoAndStop(4);
char._xscale = 100;
}else{
char.gotoAndStop(1);
}
}