/// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            // Create game systems
            InputSystem           = new InputSystem(this);
            NetworkSystem         = new NetworkSystem(this);
            RenderingSystem       = new RenderingSystem(this);
            MovementSystem        = new MovementSystem(this);
            WeaponSystem          = new WeaponSystem(this);
            EnemyAISystem         = new EnemyAISystem(this);
            NpcAISystem           = new NpcAISystem(this);
            GarbagemanSystem      = new GarbagemanSystem(this);
            CollisionSystem       = new Systems.CollisionSystem(this);
            RoomChangingSystem    = new RoomChangingSystem(this);
            QuestLogSystem        = new QuestLogSystem(this);
            SpriteAnimationSystem = new SpriteAnimationSystem(this);
            SkillSystem           = new SkillSystem(this);
            TextSystem            = new TextSystem(this);


            // Testing code.
            LevelManager.LoadContent();
            LevelManager.LoadLevel("D01F01R01");
            //End Testing Code
        }
예제 #2
0
        public void SpawnMultiple(int index, int amount)
        {
            if (index < 0 || index > entityList.Count)
            {
                Debug.LogError("Invalid index!");
                return;
            }

            for (int i = 0; i < amount; i++)
            {
                GameObject instance = Instantiate(entityList[index], spawnPoint.position, spawnPoint.rotation);

                currentEntity = (currentEntity + 1) % entityList.Count;

                EnemyBase enemyBase = instance.GetComponent <EnemyBase>();
                enemyBase.MarkSpawned();

                EnemyAISystem enemyAI = instance.GetComponent <EnemyAISystem>();
                if (patrolStartingPoint != null)
                {
                    enemyAI.addPatrolPoint(patrolStartingPoint);
                    enemyAI.ResetPatrol();
                }
            }
        }
예제 #3
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            // Create game systems
            InputSystem              = new InputSystem(this);
            NetworkSystem            = new NetworkSystem(this);
            RenderingSystem          = new RenderingSystem(this);
            MovementSystem           = new MovementSystem(this);
            WeaponSystem             = new WeaponSystem(this);
            EnemyAISystem            = new EnemyAISystem(this);
            NpcAISystem              = new NpcAISystem(this);
            GarbagemanSystem         = new GarbagemanSystem(this);
            CollisionSystem          = new Systems.CollisionSystem(this);
            RoomChangingSystem       = new RoomChangingSystem(this);
            QuestLogSystem           = new QuestLogSystem(this);
            SpriteAnimationSystem    = new SpriteAnimationSystem(this);
            SkillSystem              = new SkillSystem(this);
            TextSystem               = new TextSystem(this);
            EngineeringOffenseSystem = new EngineeringOffenseSystem(this);
            HUDSystem = new HUDSystem(this);

            InputHelper.Load();
            HUDSystem.LoadContent();

            // Testing code.
            LevelManager.LoadContent();
            LevelManager.LoadLevel("D01F01R01");
            //Song bg = Content.Load<Song>("Audio/Main_Loop");
            //MediaPlayer.Stop();
            //MediaPlayer.IsRepeating = true;
            //MediaPlayer.Play(bg);
            //End Testing Code
        }
예제 #4
0
        public void Spawn()
        {
            GameObject instance = Instantiate(entityList[currentEntity], spawnPoint.position, spawnPoint.rotation);

            currentEntity = (currentEntity + 1) % entityList.Count;

            EnemyBase enemyBase = instance.GetComponent <EnemyBase>();

            enemyBase.MarkSpawned();

            EnemyAISystem enemyAI = instance.GetComponent <EnemyAISystem>();

            if (patrolStartingPoint != null)
            {
                enemyAI.addPatrolPoint(patrolStartingPoint);
                enemyAI.ResetPatrol();
            }
        }