Skip to content

Commit

Permalink
fix scene and tile default sizes being fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
tmaster-terrarian committed Oct 7, 2024
1 parent ee63f62 commit 9aeacab
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Jelly/CollisionSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public int[] JsonTiles {
}
}

public const int TileSize = 16;
public static int TileSize { get; set; } = 16;

public bool Visible { get; set; } = true;

Expand Down
9 changes: 5 additions & 4 deletions Jelly/Scene.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@

using Jelly.Coroutines;
using Jelly.Utilities;
using Jelly.Graphics;
using Microsoft.Xna.Framework;

namespace Jelly;

public class Scene
{
private int width = CollisionSystem.TileSize * 40;
private int height = CollisionSystem.TileSize * 22;
private int width = Renderer.ScreenSize.X;
private int height = Renderer.ScreenSize.Y;

[JsonIgnore] public bool Paused { get; set; }

Expand All @@ -27,7 +28,7 @@ public int Width
get => width;
set
{
var w = MathHelper.Max(value, CollisionSystem.TileSize * 40);
var w = MathHelper.Max(value, CollisionSystem.TileSize);
CollisionSystem.Resize(w / CollisionSystem.TileSize, Height / CollisionSystem.TileSize);
width = w;
}
Expand All @@ -38,7 +39,7 @@ public int Height
get => height;
set
{
var h = MathHelper.Max(value, CollisionSystem.TileSize * 22);
var h = MathHelper.Max(value, CollisionSystem.TileSize);
CollisionSystem.Resize(Width / CollisionSystem.TileSize, h / CollisionSystem.TileSize);
height = h;
}
Expand Down

0 comments on commit 9aeacab

Please sign in to comment.