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(); } }
public void Przesun(Samolot gracz) { if (gracz.y < 200 && gracz.vy < 0) { y += -gracz.vy; } if (gracz.y > 520 && gracz.vy > 0) { y += -gracz.vy; } }
public void Wyswietlanie(CORE core, Samolot gracz) { x = gracz.x; y = gracz.y; kont = gracz.kont; vx = gracz.silnik; core.DrawSpriteEx(tekstura, new SDL.SDL_Rect() { x = 0, y = 0, w = 128, h = 128 }, new SDL.SDL_Rect() { x = (int)x, y = (int)y, w = (int)w, h = (int)h }, kont, w, h); }