Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            var sandbox = new Sandbox(WindowFactory.CreateDefault());

            sandbox.Initialize();
            sandbox.Start();
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            var window = WindowFactory.CreateDefault(600, 600);
            var w      = 20;
            var h      = 20;
            var mc     = w * h * 0.15f;

            using var game = new MinesweeperGame(
                      window,
                      w,
                      h,
                      (uint)mc
                      );

            window.KeyPressed += (sender, eventArgs) =>
            {
                if (eventArgs.Code == Keyboard.Key.R)
                {
                    game.Reset();
                }
            };

            game.Initialize();
            game.Start();
        }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            var window = WindowFactory.CreateDefault();
            var game   = new Game(window);

            window.KeyPressed += (sender, eventArgs) =>
            {
                if (eventArgs.Code == Keyboard.Key.Q)
                {
                    game.Radius = Math.Max(0, game.Radius - 5);
                }
                if (eventArgs.Code == Keyboard.Key.W)
                {
                    game.Radius += 5;
                }
                if (eventArgs.Code == Keyboard.Key.S)
                {
                    Console.WriteLine("Test");
                }
            };

            CreateDebugWindow(game);

            game.Initialize();
            game.Start();
        }
Ejemplo n.º 4
0
        static void Main(string[] args)
        {
            var window = WindowFactory.CreateDefault();
            var game   = new Game(window);

            game.Initialize();
            game.Start();
        }
Ejemplo n.º 5
0
        static void Main(string[] args)
        {
            var window = WindowFactory.CreateDefault();
            var game   = new Game(window);

            var debug = new DebugWindow <Game>(game);

            debug.Add(g => g.Balls.Select(x => x.Position + "\n"));
            debug.Show();


            game.Initialize();
            game.Start();
        }
Ejemplo n.º 6
0
        static void Main(string[] args)
        {
            var win = WindowFactory.CreateDefault();

            win.SetTitle("Circle Packing");
            var game = new Game(win);

            var debug = new DebugWindow <Game>(game);

            debug.Add(g => $"Circle count {g.CircleCount} of max {Game.MaxNumberOfElements}");
            debug.Show();

            game.Initialize();
            game.Start();
        }
Ejemplo n.º 7
0
        static void Main(string[] args)
        {
            var window = WindowFactory.CreateDefault();
            var game   = new Game(window);

            var debug = new DebugWindow <Game>(game);

            debug.Add(g => $"Pos: {g.Skater.Position}");
            debug.Add(g => $"Acl: {g.Skater.Acceleration}");
            debug.Add(g => $"Vel: {g.Skater.Velocity}");
            debug.Add(g => $"Str: {g.Skater.Strength}");
            debug.Add(g => $"Mass: {g.Skater.Mass}");
            debug.Add(g => $"Direction: {g.Skater.Velocity.Normalize()}");
            debug.Show();

            game.Initialize();
            game.Start();
        }
Ejemplo n.º 8
0
        static void Main(string[] args)
        {
            var window = WindowFactory.CreateDefault();
            var game   = new Game(window);

            window.KeyPressed += (sender, eventArgs) =>
            {
                if (eventArgs.Code == Keyboard.Key.R)
                {
                    game.Reset();
                }
            };

            // var debugWindow = new DebugWindow<Game>(game);
            // debugWindow.Add(g => $"Intersects {g.Intersection}");
            // debugWindow.Show();

            game.Initialize();
            game.Start();
        }
Ejemplo n.º 9
0
        static void Main(string[] args)
        {
            _window = WindowFactory.CreateDefault();
            _game   = new Game(_window);

            _window.KeyPressed += OnKeyPress;


            var debugWindow = new DebugWindow <Game>(_game);

            debugWindow.Add(g => $"Intersection: {g.Intersection}");


            debugWindow.Add(g => $"Num1: IntersectionMode X");
            debugWindow.Add(g => $"Num2: IntersectionMode Y");
            debugWindow.Add(g => $"Intersection Mode: {g.IntersectionMode.ToString()}");
            debugWindow.Show();

            _game.Initialize();
            _game.Start();
        }
Ejemplo n.º 10
0
        static void Main(string[] args)
        {
            var window = WindowFactory.CreateDefault(1200, 950);

            window.SetTitle("Fireworks");
            var game = new Game(window);

            window.KeyPressed += (sender, eventArgs) =>
            {
                if (eventArgs.Code == Keyboard.Key.R)
                {
                    game.SpawnRocket();
                }
                if (eventArgs.Code == Keyboard.Key.Tab)
                {
                    game.ExplosionParticleFadeMode = game.ExplosionParticleFadeMode == ParticleFade.Exponential ? ParticleFade.Linear : ParticleFade.Exponential;
                }
            };


            var debug = new DebugWindow <Game>(game);

            debug.Add(g => $"CurrentSpawnTimer: {g.CurrentSpawnTimer}");
            debug.Add(g => $"CurrentSpawnTimeAccumulator: {g.CurrentSpawnTimeAccumulator}");
            debug.Add(g => $"Rocket count: {g.RocketCount}");
            debug.Add(g => $"Explosion count: {g.ExplosionCount}");
            debug.Add(g => $"Explosion Particle Fade Mode: {g.ExplosionParticleFadeMode.ToString()}");

            // debug.Add(g => $"Rocket pos : {g.Rocket?.Position}");
            // debug.Add(g => $"Rocket vel : {g.Rocket?.Velocity}");
            // debug.Add(g => $"Rocket acl : {g.Rocket?.Acceleration}");
            // debug.Add(g => $"Rocket dir : {g.Rocket?.Direction}");
            // debug.Add(g => $"Rocket fuel: {g.Rocket?.Fuel}");
            // debug.Add(g => $"Rocket force: {g.Rocket.Fuel}");
            debug.Show();


            game.Initialize();
            game.Start();
        }