Bonjour tout le monde,
J'ai créer un labyrinthe en flash, mais le problème c'est que quandmon rond entre en collision avec un mur je ne peux pas appuyer sur 2 touches.
ex(dans le labyrinthe):si jappui sur gauche et haut en meme temps rien ne se passe. Il faut que j'appui d'abord sur gauche puis sur haut.
Voici mon code:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33 onClipEvent (enterFrame) { if (Key.isDown(Key.RIGHT)) { this._x += 5; } if (Key.isDown(Key.LEFT)) { this._x -= 5; } if (Key.isDown(Key.DOWN)) { this._y += 5; } if (Key.isDown(Key.UP)) { this._y -= 5; } i = 1; nb = 59; while (i<=nb) { if (this.hitTest(_root["mur"+i])) { if (Key.isDown(Key.RIGHT)) { this._x -= 5; } if (Key.isDown(Key.LEFT)) { this._x += 5; } if (Key.isDown(Key.DOWN)) { this._y -= 5; } if (Key.isDown(Key.UP)) { this._y += 5; } } i = i+1; } }
Merci d'essayer de m'aider, je débute on m'a parler de variable mais je ne vois pas comment les utiliser ici.
@+
Partager