internal void Init(string exampleDir) { this.exampleDir = exampleDir; //Creo el sprite drawer spriteDrawer = new Drawer(); //Creo la lista de asteroides. asteroids = new List<Asteroide>(); //Creo la lista de misiles. misiles = new List<Misil>(); ScreenWidth = GuiController.Instance.D3dDevice.Viewport.Width; ScreenHeight = GuiController.Instance.D3dDevice.Viewport.Height; //Cargo el bitmap del spritesheet de la nave. asteroidBitmap = new Bitmap(exampleDir + "Engine2D\\Media\\" + "Asteroides.png", GuiController.Instance.D3dDevice); spaceshipBitmap = new Bitmap(exampleDir + "Engine2D\\Media\\" + "nave.png", GuiController.Instance.D3dDevice); //Cargo el bitmap del misil que dispara la nave. misilBitmap = new Bitmap(exampleDir + "Engine2D\\Media\\" + "particle.png", GuiController.Instance.D3dDevice); //Creo la nave espacial spaceShip = new Spaceship(); spaceShip.Load(exampleDir, spaceshipBitmap); //Creo la cantidad de asteroides simultaneos. for (int i = 0; i < AsteroidCount; i++) { Asteroide asteroid = new Asteroide(); asteroid.Load(exampleDir, asteroidBitmap); asteroids.Add(asteroid); } }
public override void Render(float ElapsedTime, Drawer drawer) { drawer.DrawSprite(sprite); }
public override void Render(float elapsedTime, Drawer drawer) { drawer.DrawSprite(sprites[currentSprite]); }
public abstract void Render(float elapsedTime, Drawer drawer);