Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
rinrab committed Jul 30, 2023
1 parent 86c008f commit a7d80e0
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions UWP/Sprite.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ void moveY(int delta)
{
if (this.x % 16 == 0)
{
var newY = (delta < 0) ? (this.y + delta) / 16 : this.y / 16 + 1;
var cellX = (this.x + 8) / 16;
var cellY = (this.y + 8) / 16;
var cell = terrain.GetCell(cellX, cellY);
int newY = (delta < 0) ? (this.y + delta) / 16 : this.y / 16 + 1;
int cellX = (this.x + 8) / 16;
int cellY = (this.y + 8) / 16;
Cell cell = terrain.GetCell(cellX, cellY);

if (terrain.isWalkable(cellX, newY))
{
Expand Down Expand Up @@ -111,10 +111,10 @@ void moveX(int delta)
{
if (this.y % 16 == 0)
{
var newX = (delta < 0) ? (this.x + delta) / 16 : this.x / 16 + 1;
var cellX = (this.x + 8) / 16;
var cellY = (this.y + 8) / 16;
var cell = terrain.GetCell(cellX, cellY);
int newX = (delta < 0) ? (this.x + delta) / 16 : this.x / 16 + 1;
int cellX = (this.x + 8) / 16;
int cellY = (this.y + 8) / 16;
Cell cell = terrain.GetCell(cellX, cellY);

if (terrain.isWalkable(newX, cellY))
{
Expand Down

0 comments on commit a7d80e0

Please sign in to comment.