예제 #1
0
        public World()
        {
            m_camera = new Camera();
            m_player = new Player();
            m_map = new Map(new Vector2i(512, 512));
            m_dayLight = new DayLight(m_map, 30, new TimeSpan(9, 0, 0));

            s_instance = this;
        }
예제 #2
0
        //public ParticleEngine ParticleEngine { get; set; }
        public Zone(Map map, Vector2i id)
        {
            m_id = id;
            m_map = map;
            Walls = new List<Wall>();
            Lights = new List<Light>();
            Trees = new List<Tree>();
            m_wallRenderer = new SegmentRenderer();
            m_lightRenderer = new TriangleFanRenderer();
            Floor = new Floor(this);
            m_treeRenderer = new SpriteRenderer(TreesSprites.Instance);

            Generate();
        }
예제 #3
0
        public DayLight(Map map, double timeOfDay, TimeSpan startTime)
        {
            m_graphics = new Graphics();
            m_timeOfDay = timeOfDay;
            //m_currentTime = timeOfDay;
            m_map = map;
            m_maxLight = new Color4(1, 1, 1, 1);
            //m_maxLight = new Color4(0.6f, 0.6f, 0.6f, 1);
            m_maxDark = new Color4(0.1f, 0.1f, 0.05f, 1);

            m_startTime = startTime;
            m_currentTime = (1 - ConvertTimeToDayProgress(m_startTime)) * m_timeOfDay;
            m_timeStartDay = new TimeSpan(07, 0, 0);
            m_timeStartNight = new TimeSpan(19, 0, 0);
            m_timeTransition = new TimeSpan(2, 0, 0);

            //Framebuffers
            m_framebufferAllLight = new Framebuffer();
            m_textureLight = new Texture2D();
            var size = Engine.Display.GetSize();
            m_textureLight.SetData<Color4ub>(size.X, size.Y, null);
            m_framebufferAllLight.Attach(m_textureLight);
        }