C7-Game / Prototype

An early-stage, open-source 4X strategy game
https://c7-game.github.io/
MIT License
34 stars 9 forks source link

[4.x] TileMap: Horizontal Wrapping #422

Closed pcen closed 1 year ago

WildWeazel commented 1 year ago

Seems to work well after several circumnavigations. I'm still wrapping my head around how this works, pun intended, but is there any potential issue with scrolling indefinitely?

pcen commented 1 year ago

Seems to work well after several circumnavigations. I'm still wrapping my head around how this works, pun intended, but is there any potential issue with scrolling indefinitely?

The camera never goes more than one full map-width beyond the "main" map. Once it reaches that point, the camera's location is translated one map-width back towards the origin, so in terms of infinite scrolling it will just keep wrapping back towards the origin

WildWeazel commented 1 year ago

If nothing else let's merge this :)