Hello again everyone Thank you for the assistance in my previous thread.
Now, metatiles aside, I've been trying my darndest to understand background collision and with the help of some code shamelessly lifted from tokumaru (thank you!!) and explanations from Bregalad (thank you!!) I'm slowly starting to piece everything together.
However... as per usual I've having some issues.
Right now I'm just focusing on collision with the top left corner of the metasprite, so up-moving and left-moving collisions. Everything seems to work fine, but the collision is "off" a few pixels.
When colliding upwards, there is a very slight gap between the player and the tile.
When colliding leftwards, I have the opposite problem, the player moves slightly into the tile before being stopped.
(Tile $00 is the player, $01 are non-solid, and $02 are solid tiles)
These can be fixed by simply CLC/ADCing and SEC/SBCing the X and Y values when checking collision, but, I'd like to know why this is happening as it must be an error in my code/understanding of the code, and that can't be good!
Sorry if my code is difficult to read through/badly organized, I'm not a programmer by nature I'm afraid but as always, I'm trying!
Thank you
Now, metatiles aside, I've been trying my darndest to understand background collision and with the help of some code shamelessly lifted from tokumaru (thank you!!) and explanations from Bregalad (thank you!!) I'm slowly starting to piece everything together.
However... as per usual I've having some issues.
Right now I'm just focusing on collision with the top left corner of the metasprite, so up-moving and left-moving collisions. Everything seems to work fine, but the collision is "off" a few pixels.
When colliding upwards, there is a very slight gap between the player and the tile.
When colliding leftwards, I have the opposite problem, the player moves slightly into the tile before being stopped.
(Tile $00 is the player, $01 are non-solid, and $02 are solid tiles)
These can be fixed by simply CLC/ADCing and SEC/SBCing the X and Y values when checking collision, but, I'd like to know why this is happening as it must be an error in my code/understanding of the code, and that can't be good!
Sorry if my code is difficult to read through/badly organized, I'm not a programmer by nature I'm afraid but as always, I'm trying!
Thank you