Jump to content
  • entries
    652
  • comments
    2,629
  • views
    874,036

Solider Stations

SpiceWare

815 views

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:

blogentry-3056-0-26158600-1399588804_thumb.png

 

If the shot ends up in a shadow there's nothing to collide with, so the score shows 0:

blogentry-3056-0-46207200-1399588809_thumb.png

 

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:

blogentry-3056-0-17868900-1399588814_thumb.png

 

but not in empty spaces outside the image.

blogentry-3056-0-64880600-1399588819_thumb.png

 

I also changed it so that flying into the station will destroy the station as well as the ship.

 

ROMs

draconian_20140508.bin

draconian_20140508_test.bin

 

Source

Draconian_20140508.zip

  • Like 2


3 Comments


Recommended Comments

Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...