/// <summary> /// The main entry point for the application. /// </summary> static void Main(string[] args) { using (Game1 game = new Game1()) { game.Run(); } }
public EggGameScreen(Game1 game) : base(game, game.Camera.Clone()) { ConvertUnits.SetDisplayUnitToSimUnitRatio(64f); _eggtastic = game; Clips = new Dictionary<string, Clip>(); Enemies = new List<EnemyEntity>(); Eggs = new List<EggEntity>(); QueuedForDisposal = new List<CharacterEntity>(); QueuedForCreation = new List<CharacterEntity>(); ScreenSizeDefault = new Vector2(1280, 720); GraphicsDevice = game.GraphicsDevice; Viewport = GraphicsDevice.Viewport; ScreenCenter = new Vector2(ScreenSizeDefault.X / 2f, ScreenSizeDefault.Y / 2f); Content = game.Content; gameFont = Content.Load<SpriteFont>("GameFont"); #if !ANDROID BackgroundMusic = Content.Load<Song>("background-music"); MediaPlayer.Play(BackgroundMusic); MediaPlayer.Volume = 0.5f; #endif Corners = new Vertices(4); Corners.Add(new Vector2(0f)); // top-left Corners.Add(new Vector2(ScreenSizeDefault.X, 0f)); // top-right Corners.Add(new Vector2(ScreenSizeDefault.X, ScreenSizeDefault.Y)); // bottom-right Corners.Add(new Vector2(0f, ScreenSizeDefault.Y)); // bottom-left projection = Matrix.CreateOrthographicOffCenter(0f, ConvertUnits.ToSimUnits(ScreenSizeDefault.X), ConvertUnits.ToSimUnits(ScreenSizeDefault.Y), 0f, 0f, 1f); World = new World(new Vector2(0, 0)); DebugView = new DebugViewXNA(World); DebugView.RemoveFlags(DebugViewFlags.Shape); DebugView.DefaultShapeColor = Color.White; DebugView.SleepingShapeColor = Color.LightGray; DebugView.LoadContent(GraphicsDevice, Content); if (Tweak.SHOW_PHYSICS_ON_START) EnableOrDisableFlag(DebugViewFlags.Shape); Tweak.Init(); InitialiseClips(); _enemySpawner = new EnemySpawner(this, Clips["enemy"]); // World is 1 screen high, N screens wide _border = new Border(World, new Vector2(ScreenSizeDefault.X * PLAY_AREA_WIDTH_IN_SCREENS, ScreenSizeDefault.Y)); InitialiseLevel(); }
public GameOverScreen(Game1 game) : base(game, game.Camera) { Texture2D backgroundTexture = game.Content.Load<Texture2D>("gameOverScreen"); base.ActiveEntities.Add( new SpriteEntity(backgroundTexture, game.ScreenSizeDefault / 2.0f)); }
public PauseScreen(Game1 game) : base(game, game.Camera) { }