コード例 #1
0
        /// <summary>
        /// Create moveable game model
        /// </summary>
        /// <param name="setType">Set type</param>
        /// <param name="setPositionMatrix">Set position matrix</param>
        public AnimatedGameObject(GameManager.AnimatedTypes setType,
			Matrix setPositionMatrix)
            : this(setType, setPositionMatrix, DropObject.None)
        {
        }
コード例 #2
0
        /// <summary>
        /// Create static game model
        /// </summary>
        /// <param name="setType">Set type</param>
        /// <param name="setPositionMatrix">Set position matrix</param>
        public StaticGameObject(GameManager.StaticTypes setType,
			Matrix setPositionMatrix)
        {
            type = setType;
            positionMatrix = setPositionMatrix;
        }
コード例 #3
0
        /// <summary>
        /// Create moveable game model
        /// </summary>
        /// <param name="setType">Set type</param>
        /// <param name="setPositionMatrix">Set position matrix</param>
        public AnimatedGameObject(GameManager.AnimatedTypes setType,
			Matrix setPositionMatrix, DropObject setDropObject)
        {
            type = setType;

            initialPositionMatrix = positionMatrix = setPositionMatrix;
            // Use default state of not moving and idling around
            movement = Vector3.Zero;
            state = States.Idle;
            blendedStates[0] = 1.0f;
            blendedStates[1] = 0.0f;
            blendedStates[2] = 0.0f;
            blendedStates[3] = 0.0f;
            blendedStates[4] = 0.0f;
            sizeVariation = RandomHelper.GetRandomFloat(0.9f, 1.1f);
            addAnimationTime = RandomHelper.GetRandomFloat(0, 100);

            // Randomly let monsters drop one of the weapons if we did not
            // specify a drop object (like the key) yet.
            if (setDropObject == DropObject.None)
                // Use the percentages from GameManager
                dropObject = GameManager.GetDropPercentages(type);
            else
                dropObject = setDropObject;
            //Log.Write("Monster: " + type + ": dropObject=" + dropObject);

            // Goblins are smaller, ogres are a lot bigger!
            if (type == GameManager.AnimatedTypes.Goblin)
                sizeVariation *= 0.85f;
            else if (type == GameManager.AnimatedTypes.GoblinMaster)
                sizeVariation *= 1.1f;
            else if (type == GameManager.AnimatedTypes.GoblinWizard)
                sizeVariation *= 0.92f;
            else if (type == GameManager.AnimatedTypes.Ogre)
                sizeVariation *= 1.5f;
            else if (type == GameManager.AnimatedTypes.BigOgre)
                sizeVariation *= 2.5f;

            hitpoints = GameManager.MonsterHitpoints[(int)type];
        }
コード例 #4
0
        /// <summary>
        /// Allows the game to perform any initialization it needs.
        /// </summary>
        protected override void Initialize()
        {
            base.Initialize();

            // Make sure mouse is centered
            Input.Update();
            Input.MousePos = new Point(
                Window.ClientBounds.X + width / 2,
                Window.ClientBounds.Y + height / 2);
            Input.Update();

            // Load explosion effect
            //explosionTexture = new AnimatedTexture("Destroy");
            gameManager = new GameManager();

            // Create main menu screen
            //gameScreens.Push(new MainMenu());
            // Start game
            //gameScreens.Push(new Mission());
            //inGame = true;

            // Show end screen after quitting the game
            gameScreens.Push(new EndScreen());
            gameScreens.Push(new GameScreen());

            // Start music
            if (GameSettings.Default.MusicOn)
                Sound.StartMusic();

            // Start background athmosphere sound (loops)
            Sound.Play(Sound.Sounds.Athmosphere);
        }