当前位置: 首页>>代码示例>>C#>>正文


C# Tile.getY方法代码示例

本文整理汇总了C#中Tile.getY方法的典型用法代码示例。如果您正苦于以下问题:C# Tile.getY方法的具体用法?C# Tile.getY怎么用?C# Tile.getY使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Tile的用法示例。


在下文中一共展示了Tile.getY方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ToolMap

        public ToolMap(int x, int y, Texture2D pixel, Tool[][] tooltextures, SpriteFont font)
        {
            this.pixel = pixel;
            this.font = font;
            /*Color[] colors = new Color[]{Color.White, Color.Red, Color.Goldenrod,
                Color.Green, Color.Blue, Color.Chocolate, Color.Orange, Color.DarkGray,
            Color.Purple, Color.Black};
            */
            xmin = x;
            ymin = y;

            int[] col = {x,x+90};
            xmax = col[1] + 32;
            int yinterval = 44;
            ymax = y + 3 * yinterval + 32;

            xcolwidth = (xmax - xmin) / 2;
            yrowheight = (ymax - ymin) / 4;

            tools = new Tile[2][];
            for(int j = 0; j < col.Length; j++)
            {
                tools[j] = new Tile[4];
                for (int i = 0; i < 4; i++)
                {
                    tools[j][i] = new Tile(j, i, col[j] + 1, 1 + y + yinterval * i, 32, tooltextures[j][i]);
                }

            }
            selected = tools[0][0];
            selectedtop = new Rectangle(-40,-40,36,2);
            selectedbottom = new Rectangle(-40,-40,36,2);
            selectedleft = new Rectangle(-40,-40,2,36);
            selectedright = new Rectangle(-40,-40,2,36);
            updateSelected(selected.getX(), selected.getY(), selected.getLength(), selected.getLength());

            astarbutton = new Rectangle(xmin, ymax + 40, 122, 30);
            playbutton = new Rectangle(xmin, ymax + 90, 122, 30);
        }
开发者ID:gogetasama,项目名称:cs134rpg,代码行数:39,代码来源:ToolMap.cs

示例2: addToBestPath

        private Tile addToBestPath(List<Tile> bestpath, Tile toadd, Tile prev)
        {
            int x = toadd.getX();
            int y = toadd.getY();
            int mapx = toadd.getMapX();
            int mapy = toadd.getMapY();
            int len = toadd.getLength();

            if(DEBUG)
            Console.WriteLine("Adding tile at (" + mapx + "," + mapy + ") to bestpath! Cost is " + toadd.getTotalCost());

            Tile newadd = new Tile(mapx, mapy, x, y, len, astarwaypoint, Color.White);
            newadd.setPrevious(prev);
            bestpath.Add(newadd);
            return newadd;
        }
开发者ID:gogetasama,项目名称:cs134rpg,代码行数:16,代码来源:Game1.cs

示例3: setPlayerLocation

 public void setPlayerLocation(Tile newloc)
 {
     if (playertile != null)
     {
         playertile.setMapX(newloc.getMapX());
         playertile.setMapY(newloc.getMapY());
         playertile.setX(newloc.getX());
         playertile.setY(newloc.getY());
     }
     else
         Console.WriteLine("Player is null!!");
 }
开发者ID:gogetasama,项目名称:cs134rpg,代码行数:12,代码来源:TileMap.cs

示例4: setMonsterLocation

 public void setMonsterLocation(Tile newloc)
 {
     if (monstertile != null)
     {
         monstertile.setMapX(newloc.getMapX());
         monstertile.setMapY(newloc.getMapY());
         monstertile.setX(newloc.getX());
         monstertile.setY(newloc.getY());
     }
     else
         Console.WriteLine("Monster is null!!");
 }
开发者ID:gogetasama,项目名称:cs134rpg,代码行数:12,代码来源:TileMap.cs


注:本文中的Tile.getY方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。