I tried to add several parallax, in fact each dotted line between tracks, the result was weird.
I opted for a sinle parallax in front plan for now. I will for sure add some in the background when I'll finished those arts.
-- remove some graphic glitch
-- add change of track
I still have a weird glitch when just pressing quiclky X and releasing, the bike seems to move then go backward. Have to fix this behaviour.
I updated the code in your cartridge to get rid of the jumpiness. I put a few notes about what I did in your code.
Basically , you were using t, which was tracking time, and multiplying it by the bike's speed to get a shifted position to draw your sprites. This caused jumpiness, because if you stopped moving then picked up again, the t value might be different. I simply changed it to make t adjusted only by the bike's speed.
I also changed the range of the mod function on t to 32 instead of 16. This is because you have the bottom row shifted left by 1.5 times the top row. Because of this, each time t%16 got to 15, the pixels were all shifted 24 pixels (24%16 = 8pixels) left, then when t%16 = 0, they jumped back to 0 shift. By changing it to scrl = t%32, it always loops smoothly. If you want to use other multiples, you just have to make sure that the mod you use, when multiplied by your chosen speeds, will result in multiples of 16 pixels.
16 x 1 = 16 - good
32 x 1 = 32 - good
16 x 1.5 = 24 - bad
32 x 1.5 = 48 - good
example: if you wanted the bottom to scroll at 1.2 speed and the top at 1, you'd have to use mod 80.
Hope this helps.
[Please log in to post a comment]