Exemplo 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);
        }
Exemplo n.º 2
0
 public override object Clone()
 {
     //Shallow Clone
     return(new MurderLevelInfo(LevelName, WorldTime, (PlayerLocation)LobbyLocation.Clone(),
                                PlayerSpawnLocations.ToList(), GunPartLocations.ToList()));
 }