示例#1
0
        /// <summary>
        /// Default constructor
        /// </summary>
        public Player(Texture2D playerSprite, Texture2D playerSwimSprite, TileMap tiles, Vector2 startPosition, float speed, float runningSpeed)
        {
            //General player stats
            m_id         = -1;
            m_isHuman    = true;
            m_lifePoints = 100.0f;

            //refers to surrounding cells starting from topLeft in clockwise direction
            m_dirFacing = DIR.Left;

            //Setup player weapons
            m_weaponId = new int[12];
            foreach (int weapon in m_weaponId)
            {
                m_weaponId[weapon] = 0;
            }
            m_specialMoveId = -1;

            //Setup Player position
            int pos = tiles.ConvertTo1D(Convert.ToInt32(startPosition.X), Convert.ToInt32(startPosition.Y));

            m_pos    = pos;
            m_posNew = pos;


            //Player speeds
            m_speed        = speed;
            m_runningSpeed = runningSpeed;

            //Setup player sprite
            spr_player     = new Entity(playerSprite, new Vector2(startPosition.X * 64, startPosition.Y * 64));
            spr_playerSwim = new Entity(playerSwimSprite, new Vector2(startPosition.X * 64, startPosition.Y * 64));

            m_musicMan = new MusicMan();
        }
示例#2
0
 public Game1()
 {
     graphics = new GraphicsDeviceManager(this);
     Content.RootDirectory = "Content";
     m_musicMan            = new MusicMan();
 }