onClipEvent (load) { _root.haut.stop(); _root.bas.stop(); _root.gauche.stop(); _root.droite.stop(); } onClipEvent (keyDown) { if (Key.getCode() == Key.UP) { if (this._y == 1) { _root.haut._alpha = 100; _root.bas._alpha = 0; _root.gauche._alpha = 0; _root.droite._alpha = 0; } if (this._y>=87.2) { _root.haut._alpha = 100; _root.bas._alpha = 0; _root.gauche._alpha = 0; _root.droite._alpha = 0; _root.haut._x = this._x; _root.haut._y = this._y; _root.haut.play(); this._alpha = 0; this._y -= 86.5; if (_root.haut._y<=42.3) { _root.haut._y = 345-42.3; this._y = 345-42.3; } } } if (Key.getCode() == Key.DOWN) { if (this._y == 259.6) { _root.bas._alpha = 100; _root.haut._alpha = 0; _root.gauche._alpha = 0; _root.droite._alpha = 0; } if (this._y<=289.6) { _root.bas._alpha = 100; _root.haut._alpha = 0; _root.gauche._alpha = 0; _root.droite._alpha = 0; _root.bas._x = this._x; _root.bas._y = this._y; _root.bas.play(); this._alpha = 0; this._y += 86.5; if (_root.bas._y>=345-42.5) { _root.bas._y = 0; this._y = 0+42.5; } } } if (Key.getCode() == Key.LEFT) { if (this._x == 1) { _root.gauche._alpha = 100; _root.droite._alpha = 0; _root.haut._alpha = 0; _root.bas.alpha = 0; } if (this._x>=68) { _root.gauche._alpha = 100; _root.droite._alpha = 0; _root.haut._alpha = 0; _root.bas._alpha = 0; _root.gauche._x = this._x; _root.gauche._y = this._y; _root.gauche.play(); this._alpha = 0; this._x -= 67.5; if (_root.gauche._x<=0) { _root.gauche._x = 470; this._x = 470-67.5; } } } if (Key.getCode() == Key.RIGHT) { if (this._x == 405.4) { _root.droite._alpha = 100; _root.gauche._alpha = 0; _root.haut._alpha = 0; _root.bas._alpha = 0; } if (this._x<=405.4) { _root.droite._alpha = 100; _root.gauche._alpha = 0; _root.haut._alpha = 0; _root.bas._alpha = 0; _root.droite._x = this._x; _root.droite._y = this._y; _root.droite.play(); this._alpha = 0; this._x += 67.5; if (_root.droite._x>=470) { _root.droite._x = 0; this._x = 0+67.5; } } } } onClipEvent (enterFrame) { // if (this.hitTest(_root.pierre)) { // _root.haut.stop(); // _root.bas.stop(); // _root.gauche.stop(); // _root.droite.stop(); // } if (Key.getCode() == Key.UP) { if (this.hitTest(_root.pierre2) || this.hitTest(_root.pierre6) || this.hitTest(_root.pierre4)) { _root.haut.stop(); this._y += 86.5; } } if (Key.getCode() == Key.DOWN) { if (this.hitTest(_root.pierre3) || this.hitTest(_root.pierre4) || this.hitTest(_root.pierre5) || this.hitTest(_root.pierre7)) { _root.bas.stop(); this._y -= 86.5; } } if (Key.getCode() == Key.LEFT) { if (this.hitTest(_root.pierre1) || this.hitTest(_root.pierre3) || this.hitTest(_root.pierre5) || this.hitTest(_root.pierre6) || this.hitTest(_root.pierre7) || this.hitTest(_root.pierre8) || this.hitTest(_root.pierre9)) { _root.gauche.stop(); this._x += 67.5; } } if (Key.getCode() == Key.RIGHT) { if (this.hitTest(_root.pierre6) || this.hitTest(_root.pierre7) || this.hitTest(_root.pierre8) || this.hitTest(_root.pierre9)) { _root.droite.stop(); this._x -= 67.5; } } }
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question