Jump to content
IGNORED

pmg collision detection


Recommended Posts

I'm working a game I made as a kid that uses PMG. I detect collisions with the PMG players and the play field by detecting collisions with color registers 0, 1 and 2 of the redefined characters in graphics mode 17. Is it possible to detect a fourth item that uses color register 3? Or better, is it possible to detect the ASCII value of the character that the PMG player hits so you are not limited to only 3 different collision scenarios?

 

Player0 check collision with any upper case or inverse upper case characters
IF PEEK(53252)=1 OR PEEK(53252)=4 THEN ...

 

Player2 check collision with any lower case characters
IF PEEK(53254)=2 THEN ...

Link to comment
Share on other sites

You don't have upper & lower characters in gr.1 mode, they are all upper of different colours based upon bits 6&7 of the screen character.

Therefore your masks of the PnPF ($D004-$D007, 53252-53255) registers are a combination of any playfield the player is in contact with, +1 for PF0, +2 for PF1, +4 for PF2 and +8 for PF3.

Link to comment
Share on other sites

GTIA only sees raw pixel data and doesn't know if it's character or bitmap.

 

For determining character value, generally you can use a bit of maths to determine what character cells might be involved in a collision.

In Basic, a trick you can use is to temporarily blank candidate cells one at a time, if the collision condition goes away then it means there's a collision with that cell.

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   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...