Bunner takes a walk
This version introduces a second tile, containing a flag, representing the win condition. Bunner can now move but this is still largely hard-coded to handle the single movement that can actually be made in the level.
Sprites — for Bunner and the flag — are simply strings of characters which
get split up into two-dimensional arrays (by the
processDataString function). Each sprite contains different
characters which, in turn, represent different colors. So, for example, in
x represents one color, y another. For now, Bunner and the flag
are both 8x8 sprites, each ‘cell’ taking up 4x4 pixels on-screen for a total
32x32, which is our current tile size. Note that this creates sprites that are
‘edge-to-edge’ which might well be revisited in future.
dialog() function, which allows us to inform the user when
they've completed the level, is not ideal, and may be replaced when we
eventually build a proper ‘full-screen’ experience. Still, I wanted some
way of showing the user their final move!
The codebase is now roughly twice the size of the previous version. Next time round, I plan to implement movement more meaningfully, and possibly refine the sprite mechanism.