Ejemplo n.º 1
0
 public void Load()
 {
     Racket          = new Sprites.Racket();
     Racket.Position = new Vector2
                           (Global.Resolution.X - (Racket.Texture.Width * Global.Scale.X),
                           (Global.Resolution.Y / 2) - (Racket.Texture.Height * Global.Scale.Y) / 2);
 }
Ejemplo n.º 2
0
        public static void UpdateAI(Sprites.Ball Ball, Sprites.Racket AIRacket)
        {
            if (AIRacket.Position.Y + ((AIRacket.Texture.Height / 2) * Global.Scale.Y) < Ball.Position.Y)
            {
                AIRacket.Speed.Y = 0.3f;
            }

            if (AIRacket.Position.Y + ((AIRacket.Texture.Height / 2) * Global.Scale.Y) > Ball.Position.Y)
            {
                AIRacket.Speed.Y = -0.3f;
            }

            if (AIRacket.Position.Y + ((AIRacket.Texture.Height / 2) * Global.Scale.Y) == Ball.Position.Y)
            {
                AIRacket.Speed.Y = 0f;
            }
        }
Ejemplo n.º 3
0
 public void Load()
 {
     pRacket = new Sprites.Racket();
 }