public override void LoadContent()
        {
            SpriteSheet = GameManager.LoadTexture2D("SpriteSheetSS");
            LoadSprites(GameManager.Content.RootDirectory + "/spritesheetSS.xml");

            SideScrollMap sideScrollMap = new SideScrollMap("SideScrollMap");

            player = new SideScrollPlayer(new Vector2(20, sideScrollMap.Background.Height - 400));

            camera = new Camera(player);
            camera.SetBackgroundResolution(sideScrollMap.Background.Width, sideScrollMap.Background.Height);

            victoryTrigger          = new VictoryTrigger(1);
            victoryTrigger.Position = new Vector2(0, 360);
            victoryTrigger.SetSize(200, 420);
            victoryTrigger.OnActivation += OnVictory;

            deathTrigger          = new DeathTrigger(1);
            deathTrigger.Position = new Vector2(-500, sideScrollMap.Background.Height + 500);
            deathTrigger.SetSize(sideScrollMap.Background.Width + 1000, 512);
            deathTrigger.OnActivation += DeathTrigger_OnActivation;

            cake = new Cake(0, 360);

            GameManager.SetPreferredBackBufferSize(1920, 1080);
        }
Example #2
0
        /// <summary>
        /// If the player picks up this cube, the
        /// cube will know it.
        /// </summary>
        /// <param name="sideScrollPlayer"></param>
        public void ToggleHoldState(SideScrollPlayer sideScrollPlayer)
        {
            if (player != null)
            {
                player     = null;
                isGrounded = false;
            }
            else if (sideScrollPlayer != null)
            {
                player = sideScrollPlayer;
            }

            OnToggleHoldState?.Invoke();
        }
Example #3
0
 public void SetTarget(SideScrollPlayer player)
 {
     this.player = player;
 }
Example #4
0
 public Camera(SideScrollPlayer player)
 {
     Tag         = "MainCamera";
     this.player = player;
 }