Beispiel #1
0
 /// <summary>
 /// Constructor of the ground element
 /// </summary>
 /// <param name="game">Game in which the ground element is set</param>
 /// <param name="_position">Position of the ground element</param>
 public GroundElement(WarGame game, Vector3 _position, MainScene _scene)
     : base(game, _scene, _position)
 {
     gameObjectModel = game.groundElementModel;
     scale = new Vector3(widthOfGroundElement, 0.1f, heightOfGroundElement);
     maxSpeed = 0f;
     maxForce = 10 * maxSpeed;
     mass = 200.0f;
     currentSB = SBNames.None;
     isModelTextured = true;
     modelTexture = game.moonTexture;
     scene = _scene;
     boundingBox = new Bbox(this, game, scene);
     scene.SceneComponents.Add(boundingBox);
 }
Beispiel #2
0
        /// <summary>
        /// Constructor of alien craft
        /// </summary>
        /// <param name="game">Game in which the alien craft is set</param>
        public AlienCraft(WarGame game, MainScene _scene, Vector3 _position)
            : base(game, _scene, _position)
        {
            gameObjectModel = game.alienCraftModel;
            scale = new Vector3(0.5f, 0.5f, 0.5f);
            maxSpeed = 0.05f;
            maxForce = 10 * maxSpeed;
            mass = 20.0f;
            currentSB = SBNames.WanderReadyToAttack;
            currentWorld = Matrix.CreateScale(scale) * Matrix.CreateWorld(Position, lastNonZeroVelocity, Vector3.Up);

            boundingBox = new Bbox(this, game, scene);
            scene.SceneComponents.Add(boundingBox);
            boundingBox.RecalculateBoundingBox();
        }
Beispiel #3
0
        /// <summary>
        /// Constructor of the fighter
        /// </summary>
        /// <param name="game">Game in which the fighter is set</param>
        /// <param name="_position">Initial position of the fighter</param>
        public Fighter(WarGame game, Vector3 _position, MainScene _scene)
            : base(game, _scene, _position)
        {
            gameObjectModel = game.spaceShipModel;
            scale = new Vector3(0.5f, 0.5f, 0.5f);

            maxSpeed = 0.5f;
            maxForce = 10 * maxSpeed;
            mass = 20.0f;
            currentSB = SBNames.None;
            currentWorld = Matrix.CreateScale(scale) * Matrix.CreateWorld(Position, lastNonZeroVelocity, Vector3.Up);

            boundingBox = new Bbox(this, game, scene);
            scene.SceneComponents.Add(boundingBox);
            boundingBox.RecalculateBoundingBox();

            // show the bounding box if the game is in debug mode
            if (scene.IsInDebugMode)
                DebugModeToggle();
        }
Beispiel #4
0
        /// <summary>
        /// Constructor of the building
        /// </summary>
        /// <param name="game">Game where the building is set</param>
        /// <param name="_position">Position of the building</param>
        public Building(WarGame game, Vector3 _position, MainScene _scene)
            : base(game, _scene, _position)
        {
            gameObjectModel = game.castleModel;
            scale = new Vector3(0.001f, 0.001f, 0.001f);
            maxSpeed = 0f;
            maxForce = 0f;
            mass = 1000f;
            currentSB = SBNames.None;
            currentWorld = Matrix.CreateScale(scale) * Matrix.CreateWorld(Position, lastNonZeroVelocity, Vector3.Up);

            HealthPoints = 0.05f;
            bar.Show();

            boundingBox = new Bbox(this, game, scene);
            scene.SceneComponents.Add(boundingBox);
            boundingBox.RecalculateBoundingBox();

            // show the bounding box if the game is in debug mode
            if (scene.IsInDebugMode)
                DebugModeToggle();
        }