Salut, voilà, je veux refaire un jeu de tir et pour ça j'aimerais incorporer le fait que la réticule tremble un peu (ça c'est fait) et que lorsqu'on appuie sur "space", ça ne bouge plus, genre on retient ça respiration (ça aussi ça marche, mais)... mais donc,

, j'arrive à assigner un x et un y pour que ça stoppe, mais ça ne marche pas si je veux que la réticule se stope "Là" où elle est... hm... je m'explique :
-> Ca ça marche :
onClipEvent (enterFrame) {
this._x = this._x+Math.floor(Math.random()*120)/60;
this._y = this._y+Math.floor(Math.random()*60)/120;
if (Key.isDown(Key.SPACE)) {
this._x = 300; //seul truc de changé...
this._y = 300; //seul truc de changé...
} else {
this._x = this._x+Math.floor(Math.random()*120)/60;
this._y = this._y+Math.floor(Math.random()*60)/120;
}
}
-> Et ça, nan (et c ce genre là qui'l faudrait en fait...)
onClipEvent (enterFrame) {
this._x = this._x+Math.floor(Math.random()*120)/60;
this._y = this._y+Math.floor(Math.random()*60)/120;
if (Key.isDown(Key.SPACE)) {
this._x = this._x;
this._y = this._y;
} else {
this._x = this._x+Math.floor(Math.random()*120)/60;
this._y = this._y+Math.floor(Math.random()*60)/120;
}
}
j'ai gaffé où svp???
Merci pour votre "éclairage"
