Designed By
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Platform Char Kod

Aşağa gitmek

Platform Char Kod Empty Platform Char Kod

Mesaj tarafından Castiel Perş. Haz. 03, 2010 4:32 pm

onClipEvent (load) {
var ground:MovieClip = _root.ground;
var grav:Number = 0;
var gravity:Number = 2;
var speed:Number = 7;
var maxJump:Number = -12;
var touchingGround:Boolean = false;
}
onClipEvent (enterFrame) {
_y += grav;
grav += gravity;
while (ground.hitTest(_x, _y, true)) {
_y -= gravity;
grav = 0;
}
if (ground.hitTest(_x, _y+5, true)) {
touchingGround = true;
} else {
touchingGround = false;
}
if (Key.isDown(Key.RIGHT)) {
_x += speed;
}
if (Key.isDown(Key.LEFT)) {
_x -= speed;
}
if (Key.isDown(Key.UP) && touchingGround) {
grav = maxJump;
}
if (ground.hitTest(_x+(_width/2), _y-(_height/2), true)) {
_x -= speed;
}
if (ground.hitTest(_x-(_width/2), _y-(_height/2), true)) {
_x += speed;
}
if (ground.hitTest(_x, _y-(height), true)) {
grav = 3;
}
}
Castiel
Castiel
Admin
Admin

Platform Char Kod Ytbtwzh9q9
Mesaj Sayısı : 123
Rep Puanı : 5
Kayıt tarihi : 02/06/10
Platform Char Kod Wfod7dlpq8

Sayfa başına dön Aşağa gitmek

Sayfa başına dön


 
Bu forumun müsaadesi var:
Bu forumdaki mesajlara cevap veremezsiniz