###

» Wed Jun 18, 2014 6:16 am

The problem has nothing to do with C2 being unable to be pixel perfect. The problem is incorrect math. You're doing the calculations for only one of them and expecting them all to work. You placed all initial tiles at y positions -256, 0, 256, and 512 in the first example and -256, 0, and 256 in the second. By adding 8 to the y position each tick you will always get the y at 768. But the space between each tile, 256 pixels, is not divisible by 9, so the ones not at y=0 or wherever you are calculating from end up missing.

Do the math, watch the y position in the debugger or just repeatedly add 9 to 512 and watch what happens. It misses 774 and 770. It's not about either of those being divisible by 9, the problem is you're not starting from the same y position for all of the tiles, so they're offset. That's why one row works, and the others don't.

What you need is a different method. For example, you can check is the spawners are not overlapping any tiles, and if so, get the y position of the highest tile, then create a new row of tiles at that position-256.