public override void Initialize() { base.Initialize(); int floor_pos_y = this.GetWindowHeight() - 128; IceBackground background = new IceBackground(new Vector2(0, -800)); this.AddEntity(background); IcePlatform platform = new IcePlatform(new Vector2(0, floor_pos_y)); this.AddEntity(platform); MenuPenguin penguin = new MenuPenguin(new Vector2(1000, floor_pos_y - 128)); this.AddEntity(penguin); MainMenuGUI mainMenuGUI = new MainMenuGUI(); AddEntity(mainMenuGUI); GameState.Instance.SetVar <int>("floor_pos_y", floor_pos_y); this.Camera.SetScreenOffset(0.49, 0.83); this.Camera.FollowOnlyXAxis(); this.Camera.FollowEntity(penguin); }
public override void Initialize() { base.Initialize(); int floor_pos_y = this.GetWindowHeight() - 128; IceBackground background = new IceBackground(new Vector2(0, -800)); this.AddEntity(background); IcePlatform platform = new IcePlatform(new Vector2(0, floor_pos_y)); this.AddEntity(platform); Penguin penguin = new Penguin(new Vector2(300, floor_pos_y - 128)); this.AddEntity(penguin); SnakeBackground snakeBackground = new SnakeBackground(new Vector2(GetWindowWidth() / 2, 0)); AddEntity(snakeBackground); Snake snake = new Snake(new Vector2(400, floor_pos_y - 128), new Vector2(GetWindowWidth() / 2, 0), new Rectangle(0, 0, GetWindowWidth() / 2, GetWindowHeight())); AddEntity(snake); GameGUI gameGUI = new GameGUI(); AddEntity(gameGUI); Vector2 spawnPoint = new Vector2((int)penguin.GetPosition().X + this.GetWindowWidth(), floor_pos_y - 64); GameState.Instance.SetVar <int>("floor_pos_y", floor_pos_y); GameState.Instance.SetVar <Penguin>("penguin", penguin); GameState.Instance.SetVar <Vector2>("spawn_point", spawnPoint); GameState.Instance.SetVar <bool>("game_over", false); GameState.Instance.SetVar <double>("score", 0); //this.Camera.SetScreenOffset(0.18, 0.83); this.Camera.SetScreenOffset(0.10, 0.83); this.Camera.FollowOnlyXAxis(); this.Camera.FollowEntity(penguin); EnemySpawnController enemySpawnController = new EnemySpawnController(); AddSpawnController(enemySpawnController); }