@@ -387,6 +387,12 @@ private Tile LoadTile(char tileType, int x, int y)
387387 case 'P' :
388388 return LoadStartTile ( x , y ) ;
389389
390+ // Background block
391+ case ',' :
392+ Tile tile = LoadVarietyTile ( "BlockB" , 2 , TileCollision . Passable ) ;
393+ tile . TintColor = new Color ( 120 , 130 , 150 ) ;
394+ return tile ;
395+
390396 // Unknown tile type character
391397 default :
392398 throw new NotSupportedException ( String . Format ( Resources . ErrorUnsupportedTileType , tileType , x , y ) ) ;
@@ -830,8 +836,9 @@ private void DrawTiles(SpriteBatch spriteBatch)
830836 int right = ( int ) ( left + screenManager . BaseScreenSize . X / Tile . Width ) ;
831837 right = Math . Min ( right , Width - 1 ) ;
832838
833- // Reuse a single Vector2 object for tile positions to reduce memory allocations.
839+ // Reuse a single Vector2 and Color object for tile positions and tint color to reduce memory allocations.
834840 var position = new Vector2 ( ) ;
841+ var tintColor = Color . White ;
835842
836843 // Loop through each tile position within the visible range.
837844 for ( int y = 0 ; y < Height ; ++ y )
@@ -845,7 +852,9 @@ private void DrawTiles(SpriteBatch spriteBatch)
845852 position . X = x * Tile . Size . X ;
846853 position . Y = y * Tile . Size . Y ;
847854
848- spriteBatch . Draw ( texture , position , Color . White ) ;
855+ tintColor = tiles [ x , y ] . TintColor ;
856+
857+ spriteBatch . Draw ( texture , position , tintColor ) ;
849858 }
850859 }
851860 }
0 commit comments