A C64 Game - Step 97

And here's a little gameplay update, the bats. The diagonal movement was too predictable, so now there's more randomness to it.

The bat will move in curves. On every end of a curve the new direction will be decided randomly. Two tables are enough, however due to the C64 using two bit complement negative values are annoying to handle. Therefor I went the naive route and simply added code for every case. Ugly, but it works

The other thing is a little fix for a bug I found with the vanishing bats for the last portal stages. The bats could appear outside the playing area. The fix are two border values for left and right which will be set to be farther inside the screen if a portal level is run:

Attached Files

Doesn't the 6502 just use the same two's complement used in pretty much all modern CPUs? (some specialized DSPs being the only modern exception) I don't see what's so weird about it, in fact the whole point is that they can be treated the same as unsigned numbers for a lot of operations.