Exemple #1
0
        static void Main(string[] args)
        {
            CORE myCore = new CORE();

            Tekstury tekstury = new Tekstury(myCore);

            #region Zmienne
            Pocisk     pocisk     = new Pocisk(tekstury.t["pocisk"], 0, 0, 10, 10, 0, 0, 1);
            Bron       bron       = new Bron(pocisk, tekstury.t["bron"], 1);
            Samolot    gracz      = new Samolot(10, 10, 30, 30, tekstury.t["samolot"], bron);
            Przeciwnik przeciwnik = new Przeciwnik(tekstury.t["przeciwnik"], pocisk, 1000, 300, 50, 40);
            Sonda      sonda      = new Sonda(tekstury);

            #endregion

            while (myCore.bRunning)
            {
                myCore.Events();
                myCore.Clear();

                gracz.Wyswietlanie(myCore);
                przeciwnik.Wyswietlanie(myCore);
                sonda.Wyswietlanie(myCore);
                sonda.Przesun(gracz);
                przeciwnik.Przesun(gracz);



                myCore.Present();
            }
        }
Exemple #2
0
 public Bron(Pocisk pocisk, IntPtr tekstura, double masa)
 {
     this.masa     = masa;
     w             = 30;
     h             = 30;
     vx            = 0;
     x             = 0;
     y             = 0;
     kont          = 0;
     this.tekstura = tekstura;
     this.pocisk   = pocisk;
 }
Exemple #3
0
        public Przeciwnik(IntPtr tekstura, Pocisk pocisk, double x, double y, double w, double h)
        {
            this.x = x;
            this.y = y;
            this.w = w;
            this.h = h;


            zycie         = 10;
            vx            = 3;
            this.pocisk   = pocisk;
            this.tekstura = tekstura;
            t_strzal      = new Taimer(pocisk.tears);
        }
Exemple #4
0
        public Sonda(Tekstury t)
        {
            x = 1300;
            Random ran = new Random();

            y    = ran.Next(0, 720);
            h    = 40;
            w    = 40;
            kont = 0;

            zycie    = 5;
            vx       = 6;
            pocisk   = new Pocisk(t.t["pocisk"]);
            t_strzal = new Taimer(pocisk.tears);

            tekstura = t.t["sonda"];
        }
Exemple #5
0
        public void Strzelanie(CORE myCore)
        {
            t_Strzal.Sprawdzanie();

            if (User32.IsKeyPushedDown(Keys.Space) && t_Strzal.flaga == true)
            {
                Pocisk a = new Pocisk(bron.pocisk.tekstura, x, y, 10, 10, (silnik + bron.pocisk.shotspeed), kont, 1);
                wystrzelone.Add(a);
                t_Strzal.Zakonczono();
            }
            for (int i = 0; i < wystrzelone.Count; i++)
            {
                if (wystrzelone[i].x - wystrzelone[i].div_x < -wystrzelone[i].zasieg || wystrzelone[i].y - wystrzelone[i].div_y < -wystrzelone[i].zasieg)
                {
                    wystrzelone.RemoveAt(i);
                }
            }
        }
Exemple #6
0
        public virtual void Strzelanie()
        {
            t_strzal.Sprawdzanie();

            if (t_strzal.flaga == true)
            {
                Pocisk a = new Pocisk(pocisk.tekstura, x, y, 10, 10, -(vx + pocisk.shotspeed), kont, 1);
                wystrzelone.Add(a);
                t_strzal.Zakonczono();
            }

            for (int i = 0; i < wystrzelone.Count; i++)
            {
                if (wystrzelone[i].x - wystrzelone[i].div_x < -wystrzelone[i].zasieg)
                {
                    wystrzelone.RemoveAt(i);
                }
            }
        }