Example #1
0
        private Pallo LuoPallo()
        {
            Pallo pallo = new Pallo(palloRadius);

            pallo.Position = palloPosition;
            Add(pallo);
            AddCollisionHandler(pallo, KasittelePallonTormays);
            return(pallo);
        }
Example #2
0
        private void LuoKentta()
        {
            Level.CreateBorders(1.0, false);
            Level.Background.Color = Color.Black;

            pallo = LuoPallo();

            pelaaja = new Maila(mailaSize.X, mailaSize.Y, new Vector(Level.Left + 20, 0));
            Add(pelaaja);

            ai = new AI(mailaSize.X, mailaSize.Y, new Vector(Level.Right - 20, 0), pallo);
            Add(ai);

            Camera.ZoomToLevel();
        }
Example #3
0
        private void KasittelePallonTormays(PhysicsObject pPallo, PhysicsObject kohde)
        {
            Pallo pallo = pPallo as Pallo;

            if (pallo.Left <= Level.Left)
            {
                aiLaskuri.Kasvata(ResetGame);
            }
            else if (pallo.Right >= Level.Right)
            {
                pelaajaLaskuri.Kasvata(ResetGame);
            }
            else if (kohde is Maila)
            {
                pallo.OsuMailalla(kohde is AI, kohde.Y - pallo.Y);
            }
        }
Example #4
0
 public AI(double width, double height, Vector position, Pallo pallo) : base(width, height, position)
 {
     this.pallo     = pallo;
     this.IsUpdated = true;
 }