Exemple #1
0
 static Game()
 {
     window           = new Window(800, 600, "Balls", PixelFormat.RGB);
     standardPosition = new Vector2(window.width / 2, window.height);
     magicPosition    = new Vector2(70, window.height);
     speedPosition    = new Vector2(window.width - 70, window.height);
     GfxTools.Init(window);
 }
Exemple #2
0
 public void Draw()
 {
     GfxTools.DrawSprite(sprite, (int)position.X, (int)position.Y);
 }
Exemple #3
0
        public static void Play()
        {
            while (window.opened)
            {
                GfxTools.Clean();

                //input
                if (window.GetKey(KeyCode.S))
                {
                    palla.Input(standardPosition);
                }

                if (window.GetKey(KeyCode.A))
                {
                    pallaMagica.Input(magicPosition);
                }

                if (window.GetKey(KeyCode.D))
                {
                    pallaLesta.Input(speedPosition);
                }



                //update
                if (palla.IsActived)
                {
                    palla.Update();
                }

                if (pallaMagica.IsActived)
                {
                    pallaMagica.Update();
                }

                if (pallaLesta.IsActived)
                {
                    pallaLesta.Update();
                }



                //draw
                if (palla.IsActived)
                {
                    palla.Draw();
                }

                if (pallaMagica.IsActived)
                {
                    pallaMagica.Draw();
                }

                if (pallaLesta.IsActived)
                {
                    pallaLesta.Draw();
                }


                window.Blit();
            }
        }