コード例 #1
0
        protected override void Initialize()
        {
            // Screen Init
            graphics.IsFullScreen              = false;
            graphics.PreferredBackBufferWidth  = width;
            graphics.PreferredBackBufferHeight = height;
            graphics.ApplyChanges();
            Window.Title        = "Example 2.7: Attraction with many Movers";
            this.IsMouseVisible = true;

            // Graphics Init
            spriteBatch = new SpriteBatch(GraphicsDevice);
            device      = graphics.GraphicsDevice;
            Helpers.Drawing.init(device, spriteBatch);

            // Objects Init
            a      = new Attractor(width, height);
            movers = new Mover[10];
            for (int i = 0; i < movers.Length; i++)
            {
                movers[i] = new Mover(1.0f, rnd.Next(50, width - 50), rnd.Next(50, height - 50), width, height);
            }


            base.Initialize();
        }
コード例 #2
0
        protected override void Initialize()
        {
            // Screen Init
            graphics.IsFullScreen = false;
            graphics.PreferredBackBufferWidth = width;
            graphics.PreferredBackBufferHeight = height;
            graphics.ApplyChanges();
            Window.Title = "Example 2.7: Attraction with many Movers";
            this.IsMouseVisible = true;

            // Graphics Init
            spriteBatch = new SpriteBatch(GraphicsDevice);
            device = graphics.GraphicsDevice;
            Helpers.Drawing.init(device, spriteBatch);

            // Objects Init
            a = new Attractor(width, height);
            movers = new Mover[10];
            for (int i = 0; i < movers.Length; i++)
            {
                movers[i] = new Mover(1.0f, rnd.Next(50, width - 50), rnd.Next(50, height - 50), width, height);
            }

            base.Initialize();
        }