예제 #1
0
        public override Scene OnLoadScene()
        {
            this.mEngine.RegisterUpdateHandler(new FPSLogger());

            Scene scene = new Scene(1);
            scene.Background = new ColorBackground(0.09804f, 0.6274f, 0.8784f);

            Random random = new Random(RANDOM_SEED);

            for (int i = 0; i < LINE_COUNT; i++)
            {
                float x1 = (float)(random.NextDouble() * CAMERA_WIDTH);
                float x2 = (float)(random.NextDouble() * CAMERA_WIDTH);
                float y1 = (float)(random.NextDouble() * CAMERA_HEIGHT);
                float y2 = (float)(random.NextDouble() * CAMERA_HEIGHT);
                float lineWidth = (float)(random.NextDouble() * 5);

                Line line = new Line(x1, y1, x2, y2, lineWidth);

                line.SetColor((float)random.NextDouble(), (float)random.NextDouble(), (float)random.NextDouble());

                scene.getLastChild().attachChild(line);
            }

            return scene;
        }