Esempio n. 1
0
 protected override void LoadContent()
 {
     spriteBatch = new SpriteBatch(GraphicsDevice);
     Car.LoadContent(Content);
     ScoreUI.LoadContent(Content);
     GameOverUI.LoadContent(Content);
     FPSUI.LoadContent(Content);
     CountdownUI.LoadContent(Content);
     TitleUI.LoadContent(Content);
     //TODO: probably should load ALL content here. Some content (e.g. sign models) still loaded at runtime
 }
Esempio n. 2
0
        protected override void Initialize()
        {
            base.Initialize();
            Graphics = GraphicsDevice;

            //Initialize physics
            tainicom.Aether.Physics2D.Settings.MaxPolygonVertices = 16;
            world     = new World(Vector2.Zero);
            debugView = new DebugView(world);
            debugView.AppendFlags(DebugViewFlags.DebugPanel | DebugViewFlags.PolygonPoints);
            debugView.LoadContent(GraphicsDevice, Content);

            //Create player
            player = new Player(Content, CarType.SPORT, world, adjustedSpeed);
            player.DodgeCompleteCallback = DodgeCompleted;
            player.CoinGetCallback       = CoinGet;

            //Create objects
            environment    = new EnvironmentManager(Content, world);
            trafficManager = new TrafficManager(Content, world);

            //Setup graphics
            Lighting.Initialize();
            effect        = Content.Load <Effect>("effect");
            postProcessor = new PostProcessor(spriteBatch, Content.Load <Effect>("desaturate"));

            //Setup GUI
            scoreUI     = new ScoreUI();
            gameOverUI  = new GameOverUI();
            fpsUI       = new FPSUI();
            countdownUI = new CountdownUI();
            titleUI     = new TitleUI();

            //Setup input
            InputManager.Initialize();
        }