Exemplo n.º 1
0
        public GameState(GraphicsDeviceManager graphics)
        {
            this.graphics = graphics;
            mplayer = new WMPLib.WindowsMediaPlayer();
            Directory.GetCurrentDirectory();
            mplayer.URL = Path.GetDirectoryName(Assembly.GetEntryAssembly().CodeBase) + @"\Content\songs\mele.mp3";
            mplayer.settings.setMode("loop", true);
            mplayer.controls.stop();
            rand = new Random();
            one = GameState.playerNow;

            enemies = new List<Mob>();
            one.MaxWidth = 4000;
            one.MaxHeight = 2500;
            one.Pics = new Texture2D[4];
            boss = new Boss(2000, 2000);
            one.Speed += 5;
            boss.Speed = (float)2.41;
            Initialize();
            input = new InputHandler(graphics);
            enemiesRect = new List<Rectangle>();
            enemiesSourceRect = new List<Rectangle>();

            for (int i = 0; i < enemies.Count; i++)
            {

                enemiesSourceRect.Add(new Rectangle(270 * enemies[i].Frame, 0, 270, 165));
                enemiesRect.Add(new Rectangle((int)enemies[i].X, (int)enemies[i].Y, 270, 165));
            }
        }
Exemplo n.º 2
0
 public Engine()
 {
     graphics = new GraphicsDeviceManager(this);
     Content.RootDirectory = "Content";
     ContentLoader = new ContentLoader(this.Content);
     input = new InputHandler(graphics);
     this.graphics.PreferredBackBufferWidth =  GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width;
     this.graphics.PreferredBackBufferHeight = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height;
     this.graphics.ApplyChanges();
 }