Jeu de labyrinthe qui ne fonctionne pas...

Helorri Messages postés 2 Date d'inscription samedi 15 novembre 2008 Statut Membre Dernière intervention 16 novembre 2008 - 15 nov. 2008 à 20:08
Helorri Messages postés 2 Date d'inscription samedi 15 novembre 2008 Statut Membre Dernière intervention 16 novembre 2008 - 16 nov. 2008 à 15:12
Bonjour,


Je suis étudiante et j'ai comme option un cours se passant à
l'ordinateur, où l'on utilise Flash CS3 comme outil de travail. Personne n'est
vraiment habile avec le logiciel, à part les gens qui ont déjà travaillé avec
cela. Pour ma part, je n'ai jamais touché à ce genre de truc.


Mais voilà, je suis en retard pour mon projet qui est de
créer un labyrinthe où une coccinelle doit se rendre jusqu'à la sortie de
celui-ci. Or, cela fait plus de 3-4 jours que je tente de faire fonctionner
cela sans succès : ma coccinelle bouge ; mais elle passe au travers des murs.
Ma coccinelle est aussi supposée être capable de manger des insectes et des
feuilles (clip) qui disparaissent par la suite. Mais ça ne fonctionne pas non
plus. Et à chaque truc de mangé, le joueur obtient des points... mais mon
compteur refuse aussi d'augmenter. 



<!--[if !supportEmptyParas]--> <!--[endif]-->


J'ai fait exactement la même chose que la professeur nous a
montré, mais rien ne fonctionne. J'ai donc recommencé mon labyrinthe avec
quelque chose de plus simple, mais... voilà, j'ai toujours les mêmes problèmes.



<!--[if !supportEmptyParas]--> <!--[endif]-->


Voici le code que j'ai mit pour que ma coccinelle ne
traverse pas les murs :


onClipEvent (enterFrame) {



            
if (Key.isDown(Key.RIGHT)) {






            
            this._x
= this._x+10;






                        








            
            if(






                        
   (this.hitTest(_root.carre1))






                        
    ||(this.hitTest(_root.carre2))






                        
    ||(this.hitTest(_root.cotegauche))






                        
            ||(this.hitTest(_root.cotehaut))






                        
            ||(this.hitTest(_root.Carre4))






                        
            ||(this.hitTest(_root.cotebasd))






                        
            ||(this.hitTest(_root.Carre5))






                        
            ||(this.hitTest(_root.cotebasg))






                        
            ||(this.hitTest(_root.cotedroite))






                        
            ||(this.hitTest(_root.Carre3)))






            
            {






                        
            this._x = this._x-10;






                        
            }






            }






            








            if (Key.isDown(Key.LEFT)) {






            
            this._x
= this._x-10;






                        








            
            if(






                        
   (this.hitTest(_root.carre1))






                        
    ||(this.hitTest(_root.carre2))






                        
    ||(this.hitTest(_root.cotegauche))






                        
            ||(this.hitTest(_root.cotehaut))






                        
            ||(this.hitTest(_root.Carre4))






                        
            ||(this.hitTest(_root.cotebasd))






                        
            ||(this.hitTest(_root.Carre5))






                        
            ||(this.hitTest(_root.cotebasg))






                        
            ||(this.hitTest(_root.cotedroite))






                        
            ||(this.hitTest(_root.Carre3)))






            
            {






                        
            this._x = this._x+10;






                        
            }






            }






            if (Key.isDown(Key.UP)) {






            
            this._y
= this._y-10;






                        








            
            if(






                        
   (this.hitTest(_root.carre1))






                        
    ||(this.hitTest(_root.carre2))






                        
    ||(this.hitTest(_root.cotegauche))






                        
            ||(this.hitTest(_root.cotehaut))






                        
            ||(this.hitTest(_root.Carre4))






                        
            ||(this.hitTest(_root.cotebasd))






                        
            ||(this.hitTest(_root.Carre5))






                        
            ||(this.hitTest(_root.cotebasg))






                        
            ||(this.hitTest(_root.cotedroite))






                        
            ||(this.hitTest(_root.Carre3)))






            
            {






                        
            this._y = this._y+10;






                        
            }






            }






            if (Key.isDown(Key.DOWN)) {






            
            this._y
= this._y+10;






                        








            
            if(






                        
   (this.hitTest(_root.carre1))






                        
    ||(this.hitTest(_root.carre2))






                        
    ||(this.hitTest(_root.cotegauche))






                        
            ||(this.hitTest(_root.cotehaut))






                        
            ||(this.hitTest(_root.Carre4))






                        
            ||(this.hitTest(_root.cotebasd))






                        
            ||(this.hitTest(_root.Carre5))






                        
            ||(this.hitTest(_root.cotebasg))






                        
            ||(this.hitTest(_root.cotedroite))






                        
            ||(this.hitTest(_root.Carre3)))






            
            {






                        
            this._y = this._y-10;






                        
            
}



            }



            }




<!--[if !supportEmptyParas]--> <!--[endif]-->


Mais... elle continue de passer au travers de murs. J'ai 5
carrés qui sont enregistré en clip dans la bibliothèque, et 5 côtés (le côté bas
étant séparé en deux)



<!--[if !supportEmptyParas]--> <!--[endif]-->


Une image de mon jeu :
[url]http://i71.servimg.com/u/f71/11/21/72/88/flashc10.png/url



<!--[if !supportEmptyParas]--> <!--[endif]-->


Quelqu'un pourrait-il m'aider? Déjà juste arriver à ne pas faire passer
ma coccinelle au travers des murs serait un bon début, puisque je ne vois pas
ce qui cloche. J'ai un calque pour chaque item de mon labyrinthe, sauf les
carrés qui sont sur le calque "labyrinthe".

2 réponses

Mansuz Messages postés 169 Date d'inscription lundi 11 décembre 2006 Statut Membre Dernière intervention 25 janvier 2014 1
16 nov. 2008 à 14:52
0
Helorri Messages postés 2 Date d'inscription samedi 15 novembre 2008 Statut Membre Dernière intervention 16 novembre 2008
16 nov. 2008 à 15:12
Merci beaucoup, ça m'a débloqué d'avoir cet exemple sous les yeux ^^ Je viens de trouver mon erreur.
0
Rejoignez-nous