Friday 8 April 2016

Retronoid Update XVII

Time for an update methinks.

The spare room proceeds apace. Almost at the point for the replastering to be done, been a slog but almost there.

Oh, you wanted to know about the game? Sorry....

Despite the building work and the release of Kerbal Space Program 1.1 PreRelease, I managed to get some stuff done..

Stuff!
Game Over! - yes, the fail state is in and working. One minor cosmetic tweak to do, but its a proper playable game now. (Has been for ages really, just worked as if it had infinite lives - note to self, add infinite lives cheat).

Tweaked a couple of powerup states that Id missed, resetting things correctly.

Tweaked the brick graphics (again) to better match the new backgrounds.

Started tweaking the border graphics to allow for the aliens to spawn.

Started on the code for adding hiscores.

Did a bit of a code tidy, removing some defunct code.

Did a bit off research on the boss levels in Arkanoid to get an idea of what to do.

Fixed a couple of small bugs.

Added a couple of additional level transition effects.

The Issue
As a funny aside, the law of unintended consequences decided to bite me in the arse. I've had a bug I've been trying to track down for ages - its been pretty rare and tough to duplicate, a real edge case, thought I'd nailed it,  and it comes back. What was happening was that occasionally, near the edges of the play area, the ball would pass through the edge of the bat.

Turns out it wasn't a bug. Everything was working as intended.

Basically, the collision routine Id worked out is based of finding the nearest blocks to the ball and working out what one it was going to hit - this was based off centre of ball to centre of block distances. Which is great if everything is the same size, not so great if the bat is bigger or smaller.

Now, it was going to manifest more when I add aliens, so its good I've found it now.

The Solution
In the process of coding it at the moment, but it should be easy to fix. As my objects are all AABB (Axis Aligned Bounding Box) rectagles, instead of checking against the centre of the collision object I can check against the corners, find the nearest, and use that to identify the target block.

Simples!

No comments:

Post a Comment