コード例 #1
0
        /// <summary>
        /// Allows the game component to perform any initialization it needs to before starting
        /// to run.  This is where it can query for any required services and load content.
        /// </summary>
        public void Initialize(ModelTypes.PlayerType playerType, Vector3 initialPosition, float initialRotation, Vector3 boundingBoxSize, EGGEngine.Physics.World world, Weapon currentWeapon)
        {
            this.playerType = playerType;
            this.position   = initialPosition;
            this.rotation   = initialRotation;
            this.health     = ModelTypes.PlayerHealth[(int)playerType];
            this.maxHealth  = this.health;
            this.shield     = ModelTypes.ShieldHealth[(int)playerType];
            this.maxShield  = this.shield;

            this.model = Game.Content.Load <Model>(ModelTypes.PlayerModelFileName[(int)playerType]);


            physicsPlayer = new EGGEngine.Physics.Player(this.position, this.rotation, boundingBoxSize, world);
            // TODO: Add your initialization code here
            base.Initialize();
        }
コード例 #2
0
ファイル: Player.cs プロジェクト: bradleat/trafps
        /// <summary>
        /// Allows the game component to perform any initialization it needs to before starting
        /// to run.  This is where it can query for any required services and load content.
        /// </summary>
        public void Initialize(ModelTypes.PlayerType playerType, Vector3 initialPosition, float initialRotation, Vector3 boundingBoxSize, EGGEngine.Physics.World world, Weapon currentWeapon)
        {
            this.playerType = playerType;
            this.position = initialPosition;
            this.rotation = initialRotation;
            this.health = ModelTypes.PlayerHealth[(int)playerType];
            this.maxHealth = this.health;
            this.shield = ModelTypes.ShieldHealth[(int)playerType];
            this.maxShield = this.shield;

            this.model = Game.Content.Load<Model>(ModelTypes.PlayerModelFileName[(int)playerType]);

            physicsPlayer = new EGGEngine.Physics.Player(this.position, this.rotation, boundingBoxSize, world);
            // TODO: Add your initialization code here
            base.Initialize();
        }