Java game slopes tile collision
I'm trying to figure out how I can make my player move on sloped tiles. My tiles all represent RGB values, and this is how I currently handle collisions and whether the player can move there or not:
And here I check if the tile is solid, and if so, the player can move to position and I update his hitbox.x (which is the top left position of the hitbox).
My question is, how can I adjust the player hitbox y position based on what section of a sloped tile he is standing on? I have the section of the tile he is standing on but I don't know how to update the "solidity" of a sloped tile.
And here I check if the tile is solid, and if so, the player can move to position and I update his hitbox.x (which is the top left position of the hitbox).
My question is, how can I adjust the player hitbox y position based on what section of a sloped tile he is standing on? I have the section of the tile he is standing on but I don't know how to update the "solidity" of a sloped tile.