Jump to content
IGNORED

NUSIZ1 Missile Collision (and other quirks)...


KevKelley

Recommended Posts

I was playing around with some code and I had 2 NUSIZ1 copies of a missile. 
 

I used collision detection and noticed a collision statement and noticed it worked on the copy. I had thought that collision detection statement only worked on the first “copy” of a sprite and that any other would require a hit box. 
 

Reading Random Terrain’s website I noticed this:

 

Quote

DPC+ collision is pixel perfect, but doesn't take hardware-reflected sprites into account and it doesn't support NUSIZ copies or wide players. Prior to the bB 1.1d release, we couldn't use collision() to detect collisions between the virtual sprites, but now we can. When a virtual sprite collides with the playfield, you won't know exactly which one did it without coordinate checking...

 

If you use NUSIZ0 to make a double-sized or quad-sized player0, only player1 will be able to collide with all parts of it. Player2 through player9 will only register a collision with the first 8 bits to the left as if player0 is still small.


I was testing collision statements between Player0 and Missile1. 
 

So my understanding is that Player0 and Player1 and Missile1 will always detect with the copies. But if I used virtual sprites they would not register and I would have to use a hit box?

 

It just threw me for a second because I could t remember if collision always detected with copies or not. 

Edited by KevKelley
Link to comment
Share on other sites

2 hours ago, Random Terrain said:

I don't remember. Do you see any answers in this example program?

 

https://www.randomterrain.com/atari-2600-memories-batari-basic-commands.html#ex_dpc_shooting_nusiz

I hadn’t looked at that in a while. I plopped in some code in my program yesterday and started noticing that when player0 would hit the copy of the missile1 he would act as if he hit the first copy. But if I remember when I was working on Bag Boy it wouldn’t register collision with the copies… but I think that may have been because the copies were of players2-9. 
 

So I am guessing from my observations is that player1 and missile1 operate on slightly different sets of rules when it comes to collision in DPC+.

  • Like 1
Link to comment
Share on other sites

So after playing around with it some more I noticed some quirks that I never really noticed before.

 

As for the collision thing, I just have it add a value depending on where the player0x is in relation to the missile1x using a temp variable. I figured it was an easy fix without adding extra code so if I do decide to make additional screens with different placements of the missile I should have no issue.

 

I also noticed that depending on where each virtual sprite is on the y-axis and what it's NUSIZ value is, it also changes the value of the missile.  I never really paid much attention to this as I never had anything use it but in the picture I include I see how the black line (missile1) changes from being doubled with wide spacing to being single depending on the NUSIZ of the sprite, and I assume it is from bottom up since the coordinates are reversed in the DPC+ kernel, hence why it is single, then double, then single.

 

This could be cool to add some variation to the playfield.

 

 

PP_2023_12_07b.bas_1.png

  • Like 1
Link to comment
Share on other sites

1 hour ago, Gemintronic said:

I think what I've noticed in the multi sprite kernel is that the size of the missile is effected by the virtual sprite on the same horizontal plane.

 

My brain filed it away as "just how things work". 

I guess my past programs never had these conditions. I notice it will keep the NUSIZ values until the horizontal plane is shared. So that is cool. It is definitely something I can make work in my design but I thought I was screwing up something at first. 

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