Newsletter
Liste des sujets

[JS] Problème Math.atan2 avec Firefox

Kaimaro
Kaimaro
Niveau 3
13 août 2015 à 17:44:49

Bonjour, j'ai un soucis avec une variable dont la valeur sur chrome n'es pas nul mais sur firefox cette valeur vaut NaN donc je ne comprend pas trop.
Voila la variable :

rotation = Math.atan2(possourisY - this.y, possourisX - this.x);

et la function complète:

PlayerCanon.prototype.update = function () {

    rotation = Math.atan2(possourisY - this.y, possourisX - this.x);

    this.x = posX+(rayonTourelle*Math.cos(rotation));
    this.y = posY+(rayonTourelle*Math.sin(rotation));
};
Sous forums
  • Aide à l'achat Mac
  • Création de Jeux
  • Linux
  • Programmation
  • Création de sites web
  • Internet
  • Steam Deck
  • Macintosh
  • Hardware
La vidéo du moment