Monday, October 15, 2018

Bug Punch

I have one last bug (hopefully) to fix in School Rush: with the latest builds, there is an unexpected additional Bilou head showing in addition to the big punch, and stays until the “shot sprite” takes over the regular animation..

Doing some more testing, it appears that the latest unaffected build is last year’s “xmas” release. It could be something that went wrong with the refactoring, or it could be an accidental modification of the site sheet itself.

Ce n'est pas si inhabituel de voir des têtes de Bilou partout, quand mon moteur de jeu buggue, et il a remis ça. La release-de-Noël est la dernière à ne pas en soufrir. Erreur de refactoring ? modification accidentelle de la spritesheet ? A moins que ça ne soit lié à la manière dont je gère les sprites "invisibles". Il faudra vraiment que je me rajoute une commande pour ça dans les animations.

A look at the source shows that I implemented an “invisible” sprite by not picking any sprite until the 6th frame. This isn’t clean and chances are that I was exploiting some undefined behaviour. I should definitely have a dedicated command that hides the sprite through the animation that works whatever the contents of the sprite page.

Well at last, in the refactored code, there is a clean INVALID_BLOCKNO value that is set to the frame number as the GOB is created. All I need now is to make sure the sprite remains hidden until we give it another value.

edit: likely the root cause is that I just used unassigned page entry to have a transparent image. Of course, if I accidentally add an image to that page, things that once were transparent might no longer be transparent.

No comments: