Slow slow quick quick slow…

Most of the questions I get asked about writing games for the Spectrum are about graphics – so the next two posts will cover two such questions on that topic.  The first question regards how to move objects around the screen at rates other than multiples of a pixel, such as moving 2 pixels every 3 frames.

If we were writing our game using a modern language on a modern system, this wouldn’t even be a problem – the position of the object would be stored using floating-point numbers, which we could adjust however we like safe in the knowledge that the system will render our object at exactly the right place – easy.  But we’re not a modern language or system, and on the face of it can’t do either of those things – we don’t have any floating-point registers, and have to sort out the actual rendering ourselves – but it can still be done.

Continue reading

Advertisements

Rear Gunner XL – Part 2 – Setting up

I think the best way to do this conversion is type in the BASIC listing as comments, and then add our Z80 conversion of each line as we go.  This will all be stored in our main.z80 file.  That way it will be obvious what code each line translates to, and hopefully be easier to follow.

Note that this isn’t going to be the most optimal or efficient solution to converting the game, as optimising everything often leaves the code being somewhat unreadable.  I’ll offer some thoughts on how it can be improved, but I’ll leave that up to the reader 🙂

Continue reading