Example #1
0
 public Scene(ContentManager c, GraphicsDevice d)
 {
     _instance = this;
     Content = c;
     Device = d;
     Input = new Input();
     Gravity = BASE_GRAVITY;
     GravityDirection = Vector2.UnitY;
     Input.AddInputHandler(OnControllerInput);
     Seed = new Random();
 }
Example #2
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            _scene = new Scene(Content, GraphicsDevice);
            _scene.LoadSpriteFont("Fonts\\Main");
            // automatically load the background
            GameObject background = new GameObject("background");

            background.AddComponent(new Background(background, string.Format("Backgrounds\\{0}", _scene.Seed.Next(1, 4))));

            SpawnPlayers();
            //_scene.DebugStep = true;
        }