ActionScript: Detect collision between 2 circles
Avec le fameux théorème de Pythagore on peut détecter facilement des collisions entre 2 cercles. Il suffit d’utiliser les rayons des 2 cercles avec la propriétés width divisée par 2. En fait la propriété width renvoie le diamètre de l’objet circulaire. Donc si on veut le rayon on fait comme cela : rayon = diametre / 2 [...]
Posted on vendredi 3 décembre 2010 at 11:02 by admin · Permalink
· One Comment
In: ActionScript3 as3, Game Design, Astuce, Tutoriel · Tagged with: 2 collision, as3, distance, pythagore, test
In: ActionScript3 as3, Game Design, Astuce, Tutoriel · Tagged with: 2 collision, as3, distance, pythagore, test
ActionScript: Get distance between 2 MovieClips
Si on veut la distance en pixels entre 2 objets graphiques il suffit d’utiliser le théorème de Pythagore en ActionScript :). c² = a² + b² Download source : Get_Distance.zip 12345function getDistance(pObj1:MovieClip,pObj2:MovieClip):Number { var distX:Number = pObj1.x – pObj2.x; var distY:Number = pObj1.y [...]
Posted on jeudi 25 novembre 2010 at 15:09 by admin · Permalink
· One Comment
In: ActionScript3 as3, Game Design, Astuce, Tutoriel · Tagged with: 2, collision, distance, movieclip, pixel, pythagore
In: ActionScript3 as3, Game Design, Astuce, Tutoriel · Tagged with: 2, collision, distance, movieclip, pixel, pythagore
