Ejemplo n.º 1
0
 public override void Initialize()
 {
     Scenes               = CreateSceneHandler();
     Scenes.Window        = WindowService.CreateWindow("test", new Vec2(100, 100), new Vec2(100, 100));
     Scenes.Canvas        = WindowService.CreateCanvas(Scenes.Window);
     Scenes.ContentLoader = WindowService.CreateContentLoader(Scenes.Canvas);
 }
Ejemplo n.º 2
0
        public override void Initialize()
        {
            Random = new Random();

            KeyboardInputService.SetKeyAlias("Quit", SDL.SDL_Keycode.SDLK_ESCAPE);
            KeyboardInputService.SetKeyAlias("Left", SDL.SDL_Keycode.SDLK_LEFT);
            KeyboardInputService.SetKeyAlias("Right", SDL.SDL_Keycode.SDLK_RIGHT);

            Scenes = CreateSceneHandler();

            Scenes.Window        = WindowService.CreateWindow("Brakeout", new Vec2(100, 100), ScreenSize);
            Scenes.Canvas        = WindowService.CreateCanvas(Scenes.Window);
            Scenes.ContentLoader = WindowService.CreateContentLoader(Scenes.Canvas);
            Scenes.SetScene <GameScene>();
        }
Ejemplo n.º 3
0
        public override void Initialize()
        {
            Logger.Log("Starting up the Game!");

            Random = new Random();

            KeyboardInputService.SetKeyAlias("Quit", SDL.SDL_Keycode.SDLK_ESCAPE);
            KeyboardInputService.SetKeyAlias("Left", SDL.SDL_Keycode.SDLK_LEFT);
            KeyboardInputService.SetKeyAlias("Right", SDL.SDL_Keycode.SDLK_RIGHT);
            KeyboardInputService.SetKeyAlias("Up", SDL.SDL_Keycode.SDLK_UP);
            KeyboardInputService.SetKeyAlias("Down", SDL.SDL_Keycode.SDLK_DOWN);
            KeyboardInputService.SetKeyAlias("Shoot", SDL.SDL_Keycode.SDLK_z);

            Scenes = CreateSceneHandler();

            Scenes.Window        = WindowService.CreateWindow("Space Invader", new Vec2(100, 100), ScreenSize);
            Scenes.Canvas        = WindowService.CreateCanvas(Scenes.Window);
            Scenes.ContentLoader = WindowService.CreateContentLoader(Scenes.Canvas);
            Scenes.SetScene <SpaceScene>();
        }
Ejemplo n.º 4
0
        public override void Initialize()
        {
            Random        = new Random();
            Particles     = new List <Particle>();
            GravityPoints = new List <Vec2>();

            Window = WindowService.CreateWindow("Particles", new Vec2(100, 100), ScreenSize);
            Canvas = WindowService.CreateCanvas(Window);

            for (int i = 0; i < ParticlesAmount; i++)
            {
                Particles.Add(new Particle()
                {
                    Position = new Vec2(Random.Next(0, (int)ScreenSize.X), Random.Next(0, (int)ScreenSize.Y))
                });
            }

            for (int i = 0; i < 6; i++)
            {
                GravityPoints.Add(new Vec2(Random.Next(0, (int)ScreenSize.X), Random.Next(0, (int)ScreenSize.Y)));
            }
        }