コード例 #1
0
 public RectangularSpriteGrid(Vector2i cellCount, Vector2f cellSize, Sprite sprite, float spacing = 0, float offset = 0) : base(cellCount, cellSize, spacing, offset)
 {
     Cells = new RectangularSpriteCell[cellCount.Y, cellCount.X];
     for (var i = 0; i < cellCount.Y; i++)
     {
         for (var j = 0; j < cellCount.X; j++)
         {
             var position = new Vector2f(
                 j * (cellSize.X + spacing) + offset,
                 i * (cellSize.Y + spacing) + offset
                 );
             Cells[i, j] = new RectangularSpriteCell(position, cellSize, sprite);
         }
     }
 }
コード例 #2
0
 public void SpawnHome(RectangularSpriteCell cell)
 {
     world.Home = new Home(cell.Position);
 }
コード例 #3
0
 public void SpawnPasserby(RectangularSpriteCell cell)
 {
     world.Passerby = new Passerby(cell.Position);
 }
コード例 #4
0
 public void PasserbyMoveToCell(RectangularSpriteCell cell, MoveDirection moveDirection)
 {
     world.Passerby.MoveDirection = moveDirection;
     world.Passerby.NewPosition   = cell.Position;
 }