Beispiel #1
0
        public override void LoadContent(ContentManager content)
        {
            base.LoadContent(content);

            spriteBatch = new SpriteBatch(Device);
            primBatch = new PrimitiveBatch2D(Device);
        }
Beispiel #2
0
        public void Draw(GameTime g, SpriteBatch spriteBatch, PrimitiveBatch2D primBatch)
        {
            for (int i = 0; i < tiers.Count; i++)
            {
                for (int j = 0; j < tiers[i].Length; j++)
                {
                    if (tiers[i][j] == null)
                    {
                        continue;
                    }

                    tiers[i][j].Draw(g, spriteBatch, primBatch);
                }
            }
        }
Beispiel #3
0
        public void Draw(GameTime g, SpriteBatch spriteBatch, PrimitiveBatch2D primBatch)
        {
            if (available & points==0)
            {
                primBatch.FillQuad(new Vector3(Pos.X - Dim.X, Pos.Y + Dim.Y, 0),
                                   new Vector3(Pos.X + Dim.X, Pos.Y + Dim.Y, 0),
                                   new Vector3(Pos.X + Dim.X, Pos.Y - Dim.Y, 0),
                                   new Vector3(Pos.X - Dim.X, Pos.Y - Dim.Y, 0),
                                   Color.White);
            }

            else if (available & points > 0 & points < mp)
            {
                primBatch.FillQuad(new Vector3(Pos.X - Dim.X, Pos.Y + Dim.Y, 0),
                                   new Vector3(Pos.X + Dim.X, Pos.Y + Dim.Y, 0),
                                   new Vector3(Pos.X + Dim.X, Pos.Y - Dim.Y, 0),
                                   new Vector3(Pos.X - Dim.X, Pos.Y - Dim.Y, 0),
                                   Color.Yellow);
            }

            else if (available & points == mp)
            {
                primBatch.FillQuad(new Vector3(Pos.X - Dim.X, Pos.Y + Dim.Y, 0),
                                   new Vector3(Pos.X + Dim.X, Pos.Y + Dim.Y, 0),
                                   new Vector3(Pos.X + Dim.X, Pos.Y - Dim.Y, 0),
                                   new Vector3(Pos.X - Dim.X, Pos.Y - Dim.Y, 0),
                                   Color.DarkOrange);
            }

            else
            {
                primBatch.FillQuad(new Vector3(Pos.X - Dim.X, Pos.Y + Dim.Y, 0),
                                   new Vector3(Pos.X + Dim.X, Pos.Y + Dim.Y, 0),
                                   new Vector3(Pos.X + Dim.X, Pos.Y - Dim.Y, 0),
                                   new Vector3(Pos.X - Dim.X, Pos.Y - Dim.Y, 0),
                                   Color.Gray);
            }
        }