Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How does sprite 0 hit detection work?

detection hit sprite
0
Posted

How does sprite 0 hit detection work?

0

Sprite 0 hit detection is dependent on the contents of the CHR data in the sprite and background. The sprite 0 hit flag in bit 6 of $2002 clears at the end of [or shortly after] VBlank. It remains clear until two conditions are met simultaneously: the scanning beam of the display device has begun drawing [i.e., it has “hit”] sprite #0, and the graphic image in sprite 0 is overlapping with some graphic image in the background. This means that if sprite 0 contains no graphics data [all “0”s], the sprite hit bit of $2002 will not be set. And, if the background underneath sprite 0 contains no graphics data, the sprite hit bit of $2002 will likewise not be set. Sprite 0 hit detection is useful for doing split-screen scrolling. Even Super Mario Bros. uses a sprite 0 hit to scroll the lower portion of the screen [sprite 0 is hidden in the coin image in the status bar at the top of the screen]. To do sprite 0 detection in your demo or game, you have to wait for both bit 6 of $2002 to clear aft

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123