Solider Stations
One issue with the station graphics is the gaps in the image which are used to create a shadow effect. They look great, but play havoc with collision testing. I built a test version, available below, that lets you move a horizontal shot around with the right joystick. It denotes a collision by changing the score to 888888:
If the shot ends up in a shadow there's nothing to collide with, so the score shows 0:
Collision tests are done row-by-row, so I got to thinking that a way to handle that would be to also consider the rows above and below the row being tested. I should be able to fill in the shadows by ANDing the above and below rows together then ORing that with the row being tested. In pseudo code that'd be (row-1 & row+1) | row.
To test the idea, I wrote a quick a command line program. It first outputs the rows of the station using ASCII graphics:
............XXXX................ ............XXXX................ ..........XXXXXXXX.............. ..........XXXXXXXX.............. ..........XXXXXXXX.............. ..........XXXX.................. ..........XXXXXXXX.............. ..........XXXX.................. ..........XXXXXXXX.............. ......XXXXXXXX....XXXX.......... ..........XXXXXXXX.............. ......XXXXXXXX....XXXX.......... ..........XXXXXXXX.............. ..XXXX................XXXX...... ............XXXX................ XXXXXXXX............XXXXXXXX.... XXXXXXXX....XXXX....XXXXXXXX.... XXXXXXXX....XXXX....XXXXXXXX.... XXXX........XXXX....XXXX........ XXXXXXXX............XXXXXXXX.... XXXX........XXXX....XXXX........ XXXXXXXX....XXXX....XXXXXXXX.... XXXX....XXXXXXXXXXXXXXXX........ XXXXXXXX....XXXX....XXXXXXXX.... XXXX....XXXXXXXXXXXXXXXX........ XXXXXXXX............XXXXXXXX.... ............XXXX................ ..XXXX................XXXX...... ..........XXXXXXXX.............. ..........XXXXXXXX.............. ..........XXXXXXXX.............. ..........XXXX.................. ..........XXXXXXXX.............. ..........XXXX.................. ..........XXXXXXXX.............. ..........XXXX.................. ..........XXXXXXXX.............. ..XXXX................XXXX...... ............XXXX................ XXXXXXXX............XXXXXXXX.... XXXXXXXXXXXXXXXXXXXXXXXXXXXX.... XXXXXXXX....XXXX....XXXXXXXX.... XXXX....XXXXXXXXXXXXXXXX........ XXXXXXXX....XXXX....XXXXXXXX.... XXXX........XXXX....XXXX........ XXXXXXXX............XXXXXXXX.... XXXX........XXXX....XXXX........ XXXXXXXX....XXXX....XXXXXXXX.... XXXX........XXXX....XXXX........ XXXXXXXX............XXXXXXXX.... ............XXXX................ ..XXXX................XXXX...... ..........XXXXXXXX.............. ......XXXXXXXXXXXXXXXX.......... ..........XXXXXXXX.............. ......XXXXXXXX....XXXX.......... ..........XXXXXXXX.............. ..........XXXX.................. ..........XXXXXXXX.............. ..........XXXX.................. ..........XXXXXXXX.............. ..........XXXX.................. ..........XXXXXXXX.............. ................................ ............XXXX................
then again as each row would appear for collision testing:
............XXXX................ ............XXXX................ ..........XXXXXXXX.............. ..........XXXXXXXX.............. ..........XXXXXXXX.............. ..........XXXXXXXX.............. ..........XXXXXXXX.............. ..........XXXXXXXX.............. ..........XXXXXXXX.............. ......XXXXXXXXXXXXXXXX.......... ......XXXXXXXXXXXXXXXX.......... ......XXXXXXXXXXXXXXXX.......... ..........XXXXXXXX.............. ..XXXX......XXXX......XXXX...... ..XXXX......XXXX......XXXX...... XXXXXXXX....XXXX....XXXXXXXX.... XXXXXXXX....XXXX....XXXXXXXX.... XXXXXXXX....XXXX....XXXXXXXX.... XXXXXXXX....XXXX....XXXXXXXX.... XXXXXXXX....XXXX....XXXXXXXX.... XXXXXXXX....XXXX....XXXXXXXX.... XXXXXXXX....XXXX....XXXXXXXX.... XXXXXXXXXXXXXXXXXXXXXXXXXXXX.... XXXXXXXXXXXXXXXXXXXXXXXXXXXX.... XXXXXXXXXXXXXXXXXXXXXXXXXXXX.... XXXXXXXX....XXXX....XXXXXXXX.... ..XXXX......XXXX......XXXX...... ..XXXX......XXXX......XXXX...... ..........XXXXXXXX.............. ..........XXXXXXXX.............. ..........XXXXXXXX.............. ..........XXXXXXXX.............. ..........XXXXXXXX.............. ..........XXXXXXXX.............. ..........XXXXXXXX.............. ..........XXXXXXXX.............. ..........XXXXXXXX.............. ..XXXX......XXXX......XXXX...... ..XXXX......XXXX......XXXX...... XXXXXXXX....XXXX....XXXXXXXX.... XXXXXXXXXXXXXXXXXXXXXXXXXXXX.... XXXXXXXXXXXXXXXXXXXXXXXXXXXX.... XXXXXXXXXXXXXXXXXXXXXXXXXXXX.... XXXXXXXX....XXXX....XXXXXXXX.... XXXXXXXX....XXXX....XXXXXXXX.... XXXXXXXX....XXXX....XXXXXXXX.... XXXXXXXX....XXXX....XXXXXXXX.... XXXXXXXX....XXXX....XXXXXXXX.... XXXXXXXX....XXXX....XXXXXXXX.... XXXXXXXX....XXXX....XXXXXXXX.... ..XXXX......XXXX......XXXX...... ..XXXX......XXXX......XXXX...... ..........XXXXXXXX.............. ......XXXXXXXXXXXXXXXX.......... ......XXXXXXXXXXXXXXXX.......... ......XXXXXXXXXXXXXXXX.......... ..........XXXXXXXX.............. ..........XXXXXXXX.............. ..........XXXXXXXX.............. ..........XXXXXXXX.............. ..........XXXXXXXX.............. ..........XXXXXXXX.............. ..........XXXXXXXX.............. ............XXXX................ ............XXXX................
The test can be found in the source in subdirectory quadtest. The results looked good, so I dropped it in. We now get a collision in the shadows:
but not in empty spaces outside the image.
I also changed it so that flying into the station will destroy the station as well as the ship.
ROMs
Source
- 2
3 Comments
Recommended Comments