Esempio n. 1
0
        public Scene()
        {
            var entity_debug = new Entity();

            entity_debug.AddComponent(new DebugInfo());
            entities.Add(entity_debug);

            var entity_cursor = new Entity();

            entity_cursor.AddComponent(new Cursor()
            {
                Color = new Vector4(0, 1, 0, 1)
            });
            entities.Add(entity_cursor);

            var entity_player = new Entity();

            entity_player.AddComponent(new Mob()
            {
            });
            entity_player.AddComponent(new Player()
            {
            });
            entities.Add(entity_player);
            entity_player.GetComponent <Transform>().postion.Z = 0.5f;

            var entity_height_map = new Entity();

            entity_height_map.AddComponent(new LevelHeightMap());
            entities.Add(entity_height_map);

            systems.Add(new CursorRenderSystem());
            systems.Add(new CursorSystem());
            systems.Add(new PlayerMovementSystem());
            systems.Add(new PlayerInputSystem());
            systems.Add(new PlayerRenderSystem());
            systems.Add(new GUITextRendererSystem());
            systems.Add(new LevelHeightRendererSystem());
            systems.Add(new DebugInfoRendererSystem());

            GLRenderer.Zoom = 0.25f;
            GLRenderer.RecalculateViewMat();
            GLRenderer.ClearColor = new Vector4(1, 1, 1, 1);
        }
Esempio n. 2
0
 static void OnResize(int window_width, int window_height)
 {
     GLRenderer.ViewRatio = (float)window_width / (float)window_height;
     GLRenderer.RecalculateViewMat();
 }