Inheritance: MonoBehaviour
Esempio n. 1
0
        protected override void LoadContent()
        {
            base.LoadContent();


            ComponentFactory factory = new ComponentFactory(Content);

            graphics.PreferredBackBufferWidth  = 1920; // set this value to the desired width of your window
            graphics.PreferredBackBufferHeight = 1080; // set this value to the desired height of your window
            graphics.ApplyChanges();

            TextureRegion orangeRegion = new TextureRegion(Content.Load <Texture2D>("Test/orangeSquare"), 0, 0, 32, 32);

            HitboxLoader hitboxLoader = new HitboxLoader(stage);
            BoxSpawn     boxSpawn     = new BoxSpawn(factory.playerWalk[0], stage);

            playerSpawns = new PlayerSpawnLocations();
            //GunSpawn gunSpawn = new GunSpawn(factory.gunRegions, stage);

            Physic.Instance.collisionRules.Add(new MultiKey <int>(1, 2), false);

            Actor     baseActor = stage.CreateActor(0);
            TiledBase tiledBase = baseActor.AddComponent <TiledBase>();

            tiledBase.Set(Content);
            tiledBase.OnCollisionHitboxLoaded += hitboxLoader.OnCollisionHitboxLoaded;
            tiledBase.OnObjectLoaded          += boxSpawn.OnObjectLoaded;
            tiledBase.OnObjectLoaded          += playerSpawns.OnObjectLoaded;
            //tiledBase.OnObjectLoaded += gunSpawn.OnObjectLoaded;

            TiledMapComponent[] components = tiledBase.AddMap(stage, "maps/level1", true, true);
        }
Esempio n. 2
0
        /// <summary>
        /// Converts a BoxSpawn to an actual spawner object. This function is used to generate
        /// spawn groups created in Pandora's Box
        /// </summary>
        /// <param name="spawn">The BoxSpawn object describing the spawn that should be created</param>
        /// <returns>A Spawner object - null if not valid</returns>
        public static Item CreateBoxSpawn(BoxSpawn spawn)
        {
            if (spawn == null || spawn.Entries.Count == 0)
            {
                return(null);
            }

            XmlSpawner spawner = new XmlSpawner();

            spawner.Amount    = spawn.Count;
            spawner.MaxCount  = spawn.Count;
            spawner.MinDelay  = TimeSpan.FromSeconds(spawn.MinDelay);
            spawner.MaxDelay  = TimeSpan.FromSeconds(spawn.MaxDelay);
            spawner.Team      = spawn.Team;
            spawner.HomeRange = spawn.HomeRange;

            spawner.Running = false;

            spawner.Group = spawn.Group;

            XmlSpawner.SpawnObject[] spawnObjects = new Server.Mobiles.XmlSpawner.SpawnObject[spawn.Entries.Count];

            for (int i = 0; i < spawnObjects.Length; i++)
            {
                BoxSpawnEntry entry = spawn.Entries[i] as BoxSpawnEntry;

                spawnObjects[i] = new Server.Mobiles.XmlSpawner.SpawnObject(entry.Type, entry.MaxCount);
            }

            spawner.SpawnObjects = spawnObjects;

            return(spawner);
        }
Esempio n. 3
0
        /// <summary>
        /// Converts a BoxSpawn to an actual spawner object. This function is used to generate
        /// spawn groups created in Pandora's Box
        /// </summary>
        /// <param name="spawn">The BoxSpawn object describing the spawn that should be created</param>
        /// <returns>A Spawner object - null if not valid</returns>
        public static Item CreateBoxSpawn(BoxSpawn spawn)
        {
            if (spawn == null || spawn.Entries.Count == 0)
            {
                return(null);
            }

            Spawner spawner = new Spawner(spawn.Count, spawn.MinDelay, spawn.MaxDelay, spawn.Team, spawn.HomeRange, null);

            spawner.Running = false;

            spawner.Group = spawn.Group;

            foreach (BoxSpawnEntry entry in spawn.Entries)
            {
                spawner.SpawnNames.Add(entry.Type);
            }

            return(spawner);
        }
Esempio n. 4
0
        /// <summary>
        /// Converts a BoxSpawn to an actual spawner object. This function is used to generate
        /// spawn groups created in Pandora's Box
        /// </summary>
        /// <param name="spawn">The BoxSpawn object describing the spawn that should be created</param>
        /// <returns>A Spawner object - null if not valid</returns>
        public static Item CreateBoxSpawn(BoxSpawn spawn)
        {
            //
            // TODO : Convert the BoxSpawn object to your custom spawner
            // The code below (commented out) shows the implementation of this method
            // for the default Spawner object
            //


/*			if ( spawn == null || spawn.Entries.Count == 0 )
 *                              return null;
 *
 *                      Spawner spawner = new Spawner( spawn.Count, spawn.MinDelay, spawn.MaxDelay, spawn.Team, spawn.HomeRange, null );
 *                      spawner.Running = false;
 *
 *                      spawner.Group = spawn.Group;
 *
 *                      foreach ( BoxSpawnEntry entry in spawn.Entries )
 *                      {
 *                              spawner.CreaturesName.Add( entry.Type );
 *                      }
 *
 *                      return spawner; */
        }
Esempio n. 5
0
 /// <summary>
 ///     Creates a new SpawnMessage
 /// </summary>
 /// <param name="spawn">The spawn that will be created on the server</param>
 public SpawnMessage(BoxSpawn spawn)
 {
     m_Spawn = spawn;
 }
Esempio n. 6
0
 public InternalTarget(BoxSpawn spawn) : base(-1, true, TargetFlags.None)
 {
     m_Spawn = spawn;
 }