예제 #1
0
        public static void main()
        {
            Game.displayRenderTime = true;
            Game.width             = 800;
            Scene scene = new Scene("test");

            Scene.current = scene;
            scene.addCamera(new Camera("camera", 1, new Vector2d(0, 0), new Vector2d(10, 10), 0, ulong.MaxValue, Color.Wheat));
            scene.setCurrentCamera("camera");
            string  directory = Environment.CurrentDirectory;
            Texture texture   = new Texture(directory + @"\sprites\circle.png");
            Texture other     = new Texture(directory + @"\sprites\arrow.png");

            scene.addObject(new Ball("box", texture, 30, new Vector2d(0, 0), new Vector2d(0, 0), true));
            scene.addObject(new Ball("box2", texture, 30, new Vector2d(5, 0), new Vector2d(0, 0), false));
            scene.addObject(new Wall("floor", other, 2, -8 * Vector2d.UnitY, 0));
            scene.addObject(new Wall("celing", other, 4, 9.5 * Vector2d.UnitY, Angle.pi));
            scene.addObject(new Wall("right", other, 8, 9.5 * Vector2d.UnitX, Angle.piOver2));
            scene.addObject(new Wall("left", other, 16, -9.5 * Vector2d.UnitX, Angle.piOver2));
        }
예제 #2
0
        //public void remove(int milliseconds)

        /// <summary>
        /// Add this camera to a scene.
        /// </summary>
        /// <param name="scene">The scene to add to.</param>
        public override void addToScene(Scene scene)
        {
            scene.addCamera(this);
        }