Exemplo n.º 1
0
        public override void Initialize()
        {
            base.Initialize();

            AddEntity(new SeedCountHud());
            AddEntity(new MainHUD());

            Player player = new Player(NamedPositions.ChickenCoopDoor);

            AddEntity(player);

            GameState.Instance.SetVar <bool>("immediately_finish", false);

            GameState.Instance.SetVar <int>("background_height", 0);       // SET IN BACKGROUND CLASS
            GameState.Instance.SetVar <int>("background_y", 0);            // SET IN BACKGROUND CLASS
            AddEntity(new Background(new Vector2(0, 0)));
            AddEntity(new Foreground(new Vector2(0, 0)));
            GameState.Instance.SetVar <int>("BEAT_Y", GetWindowHeight() - 150);

            BeatHUD beatHUD = new BeatHUD();

            AddEntity(beatHUD);

            SuspicionBar suspicionBar = new SuspicionBar(new Vector2(GetWindowWidth() - 100, 200));

            AddEntity(suspicionBar);

            Camera.FollowEntity(player);

            GameState.Instance.SetVar <Player>("player", player);
            GameState.Instance.SetVar <int>("seeds", 0);

            GameState.Instance.SetVar <bool>("is_beat", false);
            GameState.Instance.SetVar <Beat>("current_beat", null);
            GameState.Instance.SetVar <List <Beat> >("beat_list", new List <Beat>());

            GameState.Instance.SetVar <int>("max_distance_to_chicken", 600);
            GameState.Instance.SetVar <float>("distance_to_chicken_percent", 1f);

            GameState.Instance.SetVar <string>("current_level_name", "Level 2");
            GameState.Instance.SetVar <Scene>("current_level", this);


            // BANNER HARDCODED STUFF
            float bannerScaleFactor = (float)GameState.Instance.GetCurrentScene().GetWindowWidth() / 4850;

            GameState.Instance.SetVar <int>("banner_height", (int)(bannerScaleFactor * 590));


            BeatManager beatManager = new BeatManager(GetSoundManager(), "main_theme");

            beatManager.PlaySong();
            AddSpawnController(beatManager);
        }