I am looking at the next game. An invaders clone.
I am sort of stuck on something at the moment and it's a bit tricky to explain.
So what I want to know is, how does one generate a smooth pixel level animation by updating patterns and tiles?
Here is an ascii art demonstration of the problem: In the beginning I have a tile in position 1 and I update its pattern 8 times to move pixels within the tile over from the left of the tile towards the right of the tile. When I get to the last frame in Tile 1 (Frame 7), I need to clear tile1 and set up tile2 but with the pattern such that the pixels are on the left of the tile again. It's all simple enough to understand, except that updating the patterns is instant. you get a glitch where the pattern updates but the new tile isn't drawn yet, or the new tile is drawn but with the old pattern. I don't seem to be able to figure out how to synchronize these two different ways of putting pixels on the screen.
I bet I am missing some very obvious thing here.
Code: Select all
tile1 | tile 2
Frame 0 | X....... | ........
Frame 1 | .X...... | ........
Frame 2 | ..X..... | ........
Frame 3 | ...X.... | ........
Frame 4 | ....X... | ........
Frame 5 | .....X.. | ........
Frame 6 | ......X. | ........
Frame 7 | .......X | ........
tile1 | tile 2
Frame 8 | ........ | X.......
Frame 9 | ........ | .X......
Frame A | ........ | ..X.....
Frame B | ........ | ...X....
Frame C | ........ | ....X...
Frame D | ........ | .....X..
Frame E | ........ | ......X.
Frame F | ........ | .......X