Exemple #1
0
        public AppWindow()
            : base(640/2, 1136/2)
        {
            viewWidth = 4.5f;
            viewHeight = 9.0f;
            puck = new Puck();
            puck.position = new Vector2(0.0f, 0.0f);
            puck.velocity = new Vector2(0, 0);

            paddles = new Paddle[2];
            paddles[0] = new Paddle();
            paddles[1] = new Paddle();
            paddles[0].position = new Vector2(0.0f, -0.7f);
            paddles[1].position = new Vector2(0.0f, 0.7f);

            renderer = new Renderer();
            renderer.MediaPath = mediaPath;
            renderer.Viewport(Width, Height);
            renderer.OrthoCentered(viewWidth, viewHeight);

            startMenu = new StartMenu(renderer, this);
            gameOverMenu = new GameOverMenu(renderer, this);

            opponentPlayer = new LANGameOpponentPlayer();

            physics = new Physics();

            soundEngine = new ISoundEngine();

            networking = new Networking();
            //networking.InitializeReceiver();
            //networking.InitializeSender();
              //  networking.StartGameSearch();

            //networking.UpdateReceiver = ReceiveUpdate;

            localPlayer = new LANGameLocalPlayer(() => MouseX, () => MouseY, ClientToView, IPAddress.Parse("192.168.1.108"));
        }
Exemple #2
0
 public void Draw(Renderer renderer)
 {
     if (currentFrame >= frames.Count)
         return;
     renderer.DrawTexturedQuad(frames[currentFrame].texture, frames[currentFrame].aabb);
 }
Exemple #3
0
 public void Draw(Renderer renderer)
 {
     startGameButton.Draw(renderer);
     quitButton.Draw(renderer);
 }
Exemple #4
0
 public void Draw(Renderer renderer)
 {
     playAgainButton.Draw(renderer);
     quitButton.Draw(renderer);
     mainMenuButton.Draw(renderer);
 }
Exemple #5
0
        public GameOverMenu(Renderer renderer, AppWindow app)
        {
            appWindow = app;
            playAgainButton = new Button(renderer.CreateTextureFromFile("start.png"), new OpenTK.Box2(-1, 2, 1, 1));
            mainMenuButton = new Button(renderer.CreateTextureFromFile("mainMenu.png"), new OpenTK.Box2(-1, 1, 1, -1));
            quitButton = new Button(renderer.CreateTextureFromFile("quit.png"), new OpenTK.Box2(-1, -2, 1, -4));

            playAgainButton.Clicked += StartGame;
            quitButton.Clicked += QuitGame;
            mainMenuButton.Clicked += MainMenu;
        }
Exemple #6
0
 public void Draw(Renderer renderer)
 {
     renderer.DrawTexturedQuad(texture, box);
     renderer.DrawBox(box, new Color4(1, 1, 1, 0), new Color4(1, 0, 0, 1));
 }
Exemple #7
-3
        public StartMenu(Renderer renderer, AppWindow app)
        {
            appWindow = app;
            startGameButton = new Button(renderer.CreateTextureFromFile("start.png"), new OpenTK.Box2(-1, 1, 1, -1));
            quitButton = new Button(renderer.CreateTextureFromFile("quit.png"), new OpenTK.Box2(-1, -2, 1, -4));

            startGameButton.Clicked += StartGame;
            quitButton.Clicked += QuitGame;
        }