New games every week!
SpikeTweaks Blog
14th February 2020
v0.089 - Rejigged sprite co-ordinate maths!
Trying to add Theme Three to SpikeDislike yesterday, and I had all manner of crazy maths issues.

-=-=-

8x8 grid of sprites of 64x64 pixels each, = a 512x512 spritesheet.
But if you add a little padding (1 pixel around each sprite) it becomes 528x528, and then .. apparently.. all my maths goes awry.
It can find all the sprites on a row just fine, but has some kind of odd issue finding the start of the next row.
Made all the more bizarre when you consider it's the exact same draw routine as Shoebox and Browsercade, and neither of those appear to have this issue.
.. So far!!

In the end, I hardcoded all the important co-ordinates for the different layers (it's only 8 numbers, after all) and now everything seems to flow a little better.

Today's task is to finish off Theme Three (On the Court) which also requires that I add a great big basketball hoop somewhere in all the spritesheets.

Not sure where that's going to end up!
Views 65, Upvotes 11  
Daily Blog , Sdcom
New games every week!
Site credits : Jayenkai, one crazy fool who has far too much time on his hands.
(c) Jayenkai 2023 and onwards, RSS feed

Blog - SpikeTweaks - AGameAWeek