Skip to content

Commit

Permalink
feat: sprites sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
cherrynik committed Oct 11, 2023
1 parent 2484ac7 commit 46355ec
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Libs/Systems/DefaultDrawSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ public DefaultDrawSystem(IGroup<GameEntity> group)

public void Draw(GameTime gameTime, SpriteBatch spriteBatch)
{
GameEntity[] entities = _group.GetEntities();
// todo: refactor, put it in an impl and use the impl as a dep
GameEntity[] entities = _group.GetEntities().OrderBy(x => x.transform.Position.Y).ToArray();

spriteBatch.Begin(samplerState: SamplerState.PointWrap);

Expand Down

0 comments on commit 46355ec

Please sign in to comment.