Exemplo n.º 1
0
        /// <summary>
        /// Call this to initialize a Behaviour with data supplied in a file.
        /// </summary>
        /// <param name="fileName">The file to load from.</param>
        public override void LoadContent(String fileName)
        {
            base.LoadContent(fileName);

            PointAndShootDefinition def = GameObjectManager.pInstance.pContentManager.Load <PointAndShootDefinition>(fileName);

            mGun = new GameObject(def.mGunScriptName);
            GameObjectManager.pInstance.Add(mGun);
            mGun.pPosition = mParentGOH.pPosition;
            mGun.pPosX     = mGun.pPosX + 1.0f;

            mGunCooldown           = StopWatchManager.pInstance.GetNewStopWatch();
            mGunCooldown.pLifeTime = def.mFiringDelay; // 1 bullet fired every mFiringDelay frames.

            mFiringRange           = def.mFiringRange;
            mBulletSpeed           = def.mBulletSpeed;
            mTargetClassifications = def.mTargetClassifications;
            mBulletScriptName      = def.mBulletScriptName;

            mPotentialTargets = new List <GameObject>(16);

            mSetLookTargetMsg      = new FaceForward.SetLookTargetMessage();
            mSetSpriteEffectsMsg   = new SpriteRender.SetSpriteEffectsMessage();
            mGetAttachmentPointMsg = new SpriteRender.GetAttachmentPointMessage();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Call this to initialize a Behaviour with data supplied in a file.
        /// </summary>
        /// <param name="fileName">The file to load from.</param>
        public override void LoadContent(String fileName)
        {
            base.LoadContent(fileName);

            TwinStickDefinition def = GameObjectManager.pInstance.pContentManager.Load <TwinStickDefinition>(fileName);

            mMoveSpeed = def.mMoveSpeed;

            mGun = new GameObject("GameObjects\\Items\\Gun\\Gun");
            GameObjectManager.pInstance.Add(mGun);
            mGun.pPosition = mParentGOH.pPosition;
            mGun.pPosX     = mGun.pPosX + 1.0f;
            //mGun.pPosition.Y = mGun.pPosition.Y + 4.5f;

            mGunCooldown           = StopWatchManager.pInstance.GetNewStopWatch();
            mGunCooldown.pLifeTime = 5; // 1 bullet fired every 5 frames.

            mGrenadeCooldown           = StopWatchManager.pInstance.GetNewStopWatch();
            mGrenadeCooldown.pLifeTime = 60;

            mSafeHousePlaced = false;

            mGunLevel = 0;

            mGOFloodFill = new GameObjectFloodFill();

            mGunLevelInfo = new GunLevelInfo[]
            {
                new GunLevelInfo(1.0f, 1.0f, 1.0f),
                new GunLevelInfo(2.0f, 1.5f, 1.1f),
                new GunLevelInfo(4.0f, 1.5f, 1.2f),
                new GunLevelInfo(7.0f, 1.5f, 1.3f),
                new GunLevelInfo(11.0f, 1.5f, 1.4f),
                new GunLevelInfo(16.0f, 2.0f, 1.5f),
            };

            mSpriteFxMsg                   = new SpriteRender.SetSpriteEffectsMessage();
            mGetSpriteFxMsg                = new SpriteRender.GetSpriteEffectsMessage();
            mSpriteActiveAnimMsg           = new SpriteRender.SetActiveAnimationMessage();
            mSetExtractionPointActivateMsg = new ExtractionPoint.SetExtractionPointActivateMessage();
            mGetAttachmentPointMsg         = new SpriteRender.GetAttachmentPointMessage();
            mGetTileAtObjectMsg            = new Level.GetTileAtObjectMessage();
            mSetDamageModifierMessage      = new Explosive.SetDamageMultiplierMessage();
        }