示例#1
0
        protected override void LoadContent()
        {
            mouseState   = new MouseState();
            spriteBatch  = new SpriteBatch(GraphicsDevice);
            map          = new BackgroundMap(Content.Load <Texture2D>("0.png"), graphics);
            tileoffsetx  = 50;
            tileoffsety  = 50;
            tilesx       = 17;
            tilesy       = 17;
            completeList = Statics.convertTiles(tileoffsetx, tileoffsety, Tiles.construct(0), tilesx, tilesy, map);
            foreach (Tuple <ITile, Vector2> tile in completeList)
            {
                drawableTiles.Add(new DrawableTile(Content.Load <Texture2D>("border.png"), tile.Item2, tile.Item1));
                //Console.WriteLine(tile.Item1.type());
            }
            players.Add(new Character(0, drawableTiles, Content.Load <Texture2D>("char1.png"), tilesx, tilesy));
            players.Add(new Character(0, drawableTiles, Content.Load <Texture2D>("char2.png"), tilesx, tilesy));
            players.Add(new Character(0, drawableTiles, Content.Load <Texture2D>("char3.png"), tilesx, tilesy));
            players.Add(new Character(0, drawableTiles, Content.Load <Texture2D>("char4.png"), tilesx, tilesy));
            playerOnTurn = new Random().Next(0, (players.Count - 1));
            players[playerOnTurn].setSteps(0);

            for (int i = 0; i < players.Count; i++)
            {
                sideTrackers.Add(new SideTracker(Content, graphics, i, players));
            }
            rollButton        = new RollButton(graphics, Content.Load <Texture2D>("rollbutton.png"));
            diceImage         = new DiceRoll(Content, rollButton);
            currentPlayerIcon = new CurrentPlayerTurn(Content.Load <Texture2D>("char1.png"), rollButton);
        }
示例#2
0
        public CurrentPlayerTurn(Texture2D texture, RollButton rollButton)
        {
            this.texture = texture;
            var posx = rollButton.pos.X + 12.5;
            var posy = rollButton.pos.Y + 12.5;

            pos = new Vector2((float)posx, (float)posy);
        }
示例#3
0
        public DiceRoll(ContentManager content, RollButton rollButton)
        {
            for (int i = 0; i < 7; i++)
            {
                textureList.Add(content.Load <Texture2D>("dice" + i.ToString() + ".png"));
            }
            texture = textureList[0];
            var posx = rollButton.pos.X + 225;
            var posy = rollButton.pos.Y;

            pos = new Vector2((float)posx, (float)posy);
        }