public void Init(ContentManager content, Visualisation vis, World world, GraphicsDevice graphics) { m_title_screen = new Graphics.Entity.Sprite(); m_title_screen.Init(content.Load<Texture2D>("Menu"), graphics.Viewport.Bounds); vis.AddEntity(m_title_screen); m_menu_text = new Graphics.Entity.Text[3]; for (int i = 0; i < 3; i++) { m_menu_text[i] = new Graphics.Entity.Text(); m_menu_text[i].Init(content.Load<SpriteFont>("InGameFont")); vis.AddEntity(m_menu_text[i]); } m_menu_text[0].text = "Easy"; m_menu_text[0].position = new Vector2( (((float)graphics.Viewport.Width / 1366.0f) * 641.0f), (((float)graphics.Viewport.Height / 768.0f) * 366.0f)); m_menu_text[1].text = "Medium"; m_menu_text[1].position = new Vector2( (((float)graphics.Viewport.Width / 1366.0f) * 619.0f), (((float)graphics.Viewport.Height / 768.0f) * 430.0f)); m_menu_text[2].text = "Hard"; m_menu_text[2].position = new Vector2( (((float)graphics.Viewport.Width / 1366.0f) * 637.0f), (((float)graphics.Viewport.Height / 768.0f) * 490.0f)); int height = (int)m_menu_text[2].font.MeasureString("Hard").Y; m_cursor = new Graphics.Entity.Sprite(); m_cursor.Init(content.Load<Texture2D>("cursor"), new Rectangle( 0, 0, height, height ) ); vis.AddEntity(m_cursor); }
protected override void Initialize() { graphics.PreferredBackBufferWidth = 1280; graphics.PreferredBackBufferHeight = 720; graphics.ApplyChanges(); Input.Init(GraphicsDevice.Viewport); GamePlay.Init(); m_vis = new Visualisation(); m_world = new World(m_vis); m_menu = new MenuController(); base.Initialize(); }
public static void Init(World world, ContentManager content) { Random rand = new Random(); for (int i = 0; i < GamePlay.enemy_count; i++) { Graphics.Entity.Model model = new Graphics.Entity.Model(); model.Init(content.Load<Model>("enemy/enemy")); Entity_Enemy new_enemy = new Entity_Enemy(model); new_enemy.setSoundKill = content.Load<SoundEffect>("crit_death" + rand.Next(1, 5)); new_enemy.position = GamePlay.get_enemy(i).Position; new_enemy.rotation = GamePlay.get_enemy(i).Rotation; new_enemy.waypoint = GamePlay.get_enemy(i).WayPoint; m_enemy.Add(new_enemy); world.AddEntity(new_enemy); } }