britown,
@britown@mastodon.gamedev.place avatar

I can't stress enough how important it is to have a central API for coordinate transformations.

Tile grid coords, pixel coords, internal buffer pixel, screen pixel, viewport, world, zoomed/unzoomed, you never want to just transform these in-line anywhere. Take the time to write functions for going between them all especially if you're making a something like a map editor.

I also use typedefs to help document what function signatures expect and return.

image/png

eniko,
@eniko@peoplemaking.games avatar

@britown retrofitting this into a codebase where you didn't have them is an absolute nightmare >_>

  • All
  • Subscribed
  • Moderated
  • Favorites
  • gamedev
  • ngwrru68w68
  • rosin
  • GTA5RPClips
  • osvaldo12
  • love
  • Youngstown
  • slotface
  • khanakhh
  • everett
  • kavyap
  • mdbf
  • DreamBathrooms
  • thenastyranch
  • magazineikmin
  • anitta
  • InstantRegret
  • normalnudes
  • tacticalgear
  • cubers
  • ethstaker
  • modclub
  • cisconetworking
  • Durango
  • provamag3
  • tester
  • Leos
  • megavids
  • JUstTest
  • All magazines