Exemplo n.º 1
0
 protected override void LoadContent()
 {
     spriteBatch       = new SpriteBatch(GraphicsDevice);
     assets            = new AssetStore(Content, GraphicsDevice, new AnimationFactory());
     postProcessEffect = Content.Load <Effect>("effects/PostProcess");
     effects           = new Effects(Content.Load <Effect>("effects/SolidThing"),
                                     Content.Load <Effect>("effects/SpiritRealm"),
                                     Content.Load <Effect>("effects/Background"));
     emitterFactory = new ParticleEmitterFactory(assets);
     world          = new World(new EntityFactory(assets),
                                new RoomBackground(assets.BrickTile, assets.TorchLight, new Vector2(4000, 4000), spriteBatch), // Hack
                                emitterFactory);
 }
Exemplo n.º 2
0
        public World(EntityFactory entityFactory, RoomBackground rb, ParticleEmitterFactory emitterFactory)
        {
            this.entityFactory  = entityFactory;
            this.emitterFactory = emitterFactory;
            var  roomFactory = new RoomFactory(entityFactory);
            Room room1       = roomFactory.Room1(rb);
            Room room2       = roomFactory.Room2(rb);
            Room room3       = roomFactory.Room3(rb);

            rooms.Add(room1);
            rooms.Add(room2);
            rooms.Add(room3);
            LinkDoors(room1.doors[0], room2.doors[0]);
            LinkDoors(room2.doors[1], room3.doors[0]);
            ActiveRoom = rooms[0];
            ActiveRoom.particleEffects.Add(emitterFactory.Flame(new Vector2(200, 700)));
            player = entityFactory.Player(new Vector2(200, 800));
        }