Exemplo n.º 1
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);
            ShapeTextures.initGraphics(graphics);
            for (int i = 0; i < 20; i++)
            {
                var  circ = genCircle();
                bool good = true;
                foreach (Primitive p in Circles)
                {
                    if (p.shapeType.Intersects(circ.shapeType))
                    {
                        good = false;
                    }
                }
                if (good == true)
                {
                    Circles.Add(circ);
                }
                else
                {
                    i--;
                }
            }
            Circles.Sort((x, y) => - x.Mass.CompareTo(y.Mass));
            font        = Content.Load <SpriteFont>("mainFont");
            gui         = new GraphicalInterface(graphics.GraphicsDevice, font);
            gui.infoBar = Content.Load <Texture2D>("guiWindow1");

            // TODO: use this.Content to load your game content here
        }
Exemplo n.º 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);
            ShapeTextures.initGraphics(graphics);
            for (int i = 0; i < 20; i++) {
                var circ = genCircle();
                bool good = true;
                foreach (Primitive p in Circles) {
                    if (p.shapeType.Intersects(circ.shapeType))
                        good = false;
                }
                if (good == true)
                    Circles.Add(circ);
                else
                    i--;
            }
            Circles.Sort((x, y) => -x.Mass.CompareTo(y.Mass));
            font = Content.Load<SpriteFont>("mainFont");
            gui = new GraphicalInterface(graphics.GraphicsDevice, font);
            gui.infoBar = Content.Load<Texture2D>("guiWindow1");

            // TODO: use this.Content to load your game content here
        }