Erik_
Refactored it a bit so now there's no weird transformations.
Thu Mar 25, 2021 4:13pm
24.190.98.107

I removed the "if player's position in the x/y is less than so and so" and just made the player's screen position constant. I was having a weird issue where as you approached 1,1 on the map, you would move 2 tiles instead of one. The new way fixes this. To get the player's map position, I just need to add the x/y offset constants to the current x/y map position.

Here's a low quality gif showing it in action. As you can see, as you approach position 1,1 the "void" can be seen whereas the old way, nothing was able to be displayed if the map position was less than 1 in either direction.


    • This is the second time of me writing this after clearing... I guess that's definitely a sign it needs to be rewritten. :) * Player position holds x/y coordinates on the tile map. * Screen is drawn based on player xy as the starting point and drawn until it reaches the defined screen width and ... more
      • Refactored it a bit so now there's no weird transformations.- Erik_, Thu Mar 25 2021 4:13pm
  • Click here to receive daily updates
    "Forces act when not restrained" - Puckdropper