Exemplo n.º 1
0
 public Projectile(Game game, float échelleInitiale, Vector3 rotationInitiale, Vector3 positionInitiale, ObjetDeBaseVectoriel firerer, int laneIndex)
     : base(game, échelleInitiale, rotationInitiale, positionInitiale, 60f)
 {
     LaneIndex = laneIndex;
     friendly = firerer is Joueur;
     MiddleColor = friendly ? Color.Cyan : firerer is Flipper ? Color.Red : firerer is Tanker ? Color.DeepPink : Color.LimeGreen;
     CalculerVitesse();
     CalculateDisplacement(firerer);
     FixedUpdate();
 }
Exemplo n.º 2
0
 void CalculateDisplacement(ObjetDeBaseVectoriel firerer)
 {
     float deltaY = friendly ? (firerer as Joueur).level_.DeltaY : -(firerer as Ennemi).level_.DeltaY;
     displacement = new Vector3(0f, deltaY / 15f, (friendly ? -1 : 1)) * VITESSE;
 }