Пример #1
0
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);


            //
            //
            //
            startTime = Stopwatch.GetTimestamp();
            lastObstacleUpdateTime = startTime;


            //
            // Add first obstacles
            //
            GenerateObstacles();

            //
            // Load Controls
            //
            this.playerPositionControl = new TrinaryInt32Control(Keys.Left, Keys.Right, 1, 0, PlayerPositionRange - 1, true);

            //
            // Load Fonts
            //
            this.miramonte18Font = Content.Load <SpriteFont>("Miramonte18");
        }
Пример #2
0
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);

            Viewport viewport   = GraphicsDevice.Viewport;
            Int32    viewWidth  = viewport.Width;
            Int32    viewHeight = viewport.Height;

            //
            // Universe Parameters
            //
            minX             = -375;
            maxX             = 375;
            width            = maxX - minX;
            minY             = -220;
            maxY             = 220;
            height           = maxY - minY;
            universeEdgeRule = UniverseEdgeRules.Reflect;

            updatesPerFrame = 100;


            cameraX      = -390;
            cameraY      = -235;
            pixelsPerDot = 1;



            //
            // Controls
            //
            this.cameraXControl = new TrinaryInt32Control(Keys.A, Keys.D, 1, (Int32)minX - 50, (Int32)maxX + 50);
            this.cameraYControl = new TrinaryInt32Control(Keys.W, Keys.S, 1, (Int32)minY - 50, (Int32)maxY + 50);


            //
            // Load World Grid
            //
            gridWidth  = 20;
            gridHeight = 20;

            //
            // Load Fonts
            //
            this.miramonte18Font = Content.Load <SpriteFont>("Miramonte18");


            //
            // Create random dots
            //
            for (int i = 0; i < 10; i++)
            {
                dots.Add(new Dot(random.Next((Int32)width) + minX, random.Next((Int32)height) + minY,
                                 (random.Next(3) - 1) * 800, (random.Next(3) - 1) * 800));
            }


            //
            // Load Textures
            //


            //
            // Load Primitives
            //


            //
            // Load Models
            //
        }