Home » Adobe Flash » Adobe Flash Tutorial Cartoon » Video


Ich hoffe das Tutorial hat euch weiter geholfen!
Bitte gebt mir Feedback über meine Videos!
Flash Game Video : http://www.youtube.com/watch?v=J1LInJai2fw
Wissen von : http://www.youtube.com/user/FrislidProductions?feature=g-user-s
Der neue Code für eure Figur :
onClipEvent (load) {
var ground:MovieClip = _root.ground;
var grav:Number = 0;
var gravity:Number = 2;
var speed:Number = 7;
var maxJump:Number = -16;
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+6, true)) {
touchingGround = true;
} else {
touchingGround = false;
}
if (Key.isDown(Key.RIGHT)) {
_x += speed;
_xscale = 100
}
if (Key.isDown(Key.LEFT)) {
_x -= speed;
_xscale = -100
}
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;
}
}