Skip to content

Commit

Permalink
Added windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dwergi committed Aug 20, 2024
1 parent 69ae1a0 commit 991b65c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
12 changes: 10 additions & 2 deletions GMTK2024.Shared/Background.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public class Background : IDrawable
private readonly Texture2DRegion m_ceiling;
private readonly Texture2DRegion m_outerWall;
private readonly Texture2DRegion m_ceilingCorner;
private readonly Texture2DRegion m_window;

private readonly List<Texture2DRegion> m_cashierFrames;
private int m_currentCashierFrame;
Expand All @@ -39,6 +40,7 @@ public Background()
m_ceiling = m_atlas.GetRegion( "ceiling" );
m_outerWall = m_atlas.GetRegion( "outer_wall" );
m_ceilingCorner = m_atlas.GetRegion( "ceiling_corner" );
m_window = m_atlas.GetRegion( "window" );

m_cashierFrames = m_atlas.Where( r => r.Name.StartsWith(CASHIER_PREFIX ) )
.OrderBy( r => int.Parse( r.Name[ CASHIER_PREFIX.Length.. ] ) )
Expand Down Expand Up @@ -80,7 +82,7 @@ public void Draw( SpriteBatch batch, OrthographicCamera camera )
batch.Draw( m_ceilingCorner, Globals.TileToWorld( Globals.TILE_LEFT, Globals.TILE_TOP - 1 ), isNight ? new( 50, 50, 50 ) : Color.White, 0, Vector2.Zero, Vector2.One, SpriteEffects.None, 0 );
batch.Draw( m_ceilingCorner, Globals.TileToWorld( Globals.TILE_RIGHT - 1, Globals.TILE_TOP - 1 ), isNight ? new( 50, 50, 50 ) : Color.White, 0, Vector2.Zero, Vector2.One, SpriteEffects.FlipHorizontally, 0 );


// background walls
for( int y = 0; y < Globals.TILE_TOP - 1; ++y )
{
for( int x = Globals.TILE_LEFT + 1; x < Globals.TILE_RIGHT - 1; ++x )
Expand All @@ -90,7 +92,13 @@ public void Draw( SpriteBatch batch, OrthographicCamera camera )
continue;
}

batch.Draw( m_wall, Globals.TileToWorld( x, y ), isNight ? new( 50, 50, 50 ) : Color.White );
Texture2DRegion sprite = m_wall;
if( y == 10 && (x == -12 || x == -5 || x == 2 || x == 9) )
{
sprite = m_window;
}

batch.Draw( sprite, Globals.TileToWorld( x, y ), isNight ? new( 50, 50, 50 ) : Color.White );
}
}

Expand Down
Binary file modified GMTK2024.Shared/Content/Background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions GMTK2024.Shared/Content/Background.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@
<SubTexture name="outer_wall" x="262" y="164" width="64" height="64" />
<SubTexture name="plant" x="328" y="164" width="64" height="64" />
<SubTexture name="wall" x="394" y="164" width="64" height="64" />
<SubTexture name="window" x="66" y="196" width="64" height="64" />
</TextureAtlas>
Binary file added SourceContent/Background/window.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 991b65c

Please sign in to comment.