It’s probably going to change by the same you see this though. I think I finally cracked a good system for all the map pointers and what not when I was in the shower, so I’m going to try and add that in right now.
That’s some stuff from earlier before. I decided to just make the map dimensions themselves an array then use a single variable to just select the current map dimensions. Of course, still a pointer for the actual map data.
I was assuming that the entire map would be one hitbox, that’s what Rect does, right? With Rect you can’t have like . . . idk, organic shapes? Not really organic, but like more complex than a single rectangle because it’s like multiple rectangles protruding from the ground-which is a rectangle too-if you know what I mean.
Given the tile coordinates of a tile (i.e. its row and column index in the array of map data, not its position in the virtual world, or the position at which it is drawn to the screen) you can calculate a rectangle that represents the ‘physical’ space a tile occupies in the virtual world.
Then you need to create a Rect for the player, for which you’ll need the player’s world coordinates (as opposed to the player’s screen coordinates).
That’s only half the battle though. Once you know that a player is colliding with a tile, you need to decide how to resolve that situation.