/// <summary> /// Public UpdateMoveAndPosition de la classe PacMan /// </summary> /// <param name="gameTime"></param> /// <param name="hashCode"></param> /// <param name="listNextNodes"></param> /// <param name="pacPos"></param> /// <param name="ListNextIsWall"></param> /// <param name="leftCoridor"></param> /// <param name="rightCoridor"></param> public override void UpdateMoveAndPosition(GameTime gameTime, int hashCodeDirPac, List <Vector2> listNextNodes, Vector2 pacPos, List <bool> listNextNodeIsWall, Vector2 leftCoridor, Vector2 rightCoridor, Vector2 upCoridor, Vector2 downCoridor, float[] lerpCoefArray) { HashCodeDir = hashCodeDirPac; NextNode = listNextNodes; SpritePos = pacPos; ListNextIsWall = listNextNodeIsWall; LerpCoefArray = lerpCoefArray; PacManAnimation(VectDir.ToString()); base.UpdateMoveAndPosition(gameTime, HashCodeDir, NextNode, SpritePos, ListNextIsWall, leftCoridor, rightCoridor, upCoridor, downCoridor, LerpCoefArray); }
/// <summary> /// Méthode DrawNormal /// </summary> /// <param name="spriteBatch"></param> public void DrawNormal(SpriteBatch spriteBatch) { OpenCloseMouth(); //Dessin des "frames" suivant les directions de PacMan switch (VectDir.ToString()) { case "Up": this._frameColumn = 3; break; case "Down": this._frameColumn = 1; break; case "Left": this._frameColumn = 0; break; case "Right": this._frameColumn = 2; break; } SpriteTexture = texturePac; recPacAlive = new Rectangle((int)SpritePos.X - 3, (int)SpritePos.Y - 3, 30 - 7, 30 - 7); recSourceAlive = new Rectangle((_frameColumn) * 30, (this._frameline) * 30, 30, 30); base.Draw(spriteBatch, SpriteTexture, recPacAlive, recSourceAlive, Color.White, 0f, new Vector2(0, 0), SpriteEffects.None, 0f); }