tile/sprite lineup glitch?

stevenshepherd

New member
I have a tile that is meant to line up with a sprite (the bottom half will be animated which is why I divided them like that). Where they line up, it is supposed to be seamless; pixels are filled in all the way to the bottom edge of the tile, and the top half of the sprite. But, when they appear on the screen, there is a black row of pixels that shouldn't be there.
 

Attachments

  • tile sprite glitch.png
    tile sprite glitch.png
    1.5 KB · Views: 2,685

dale_coop

Moderator
Staff member
Yeah I have the exact same problem, I align my monster with my spirte, it’s perfect in NESMaker, but when compiled and run, in the actual game it’s 1 pixel misaligned.


57396D91-5AC1-45F5-B6B3-5EE02C6E1E4F.jpeg
 

RadJunk

Administrator
Staff member
Ah - so your OBJECT is lining up one pixel off from the background tiles, is that what you're saying? Are you both experiencing it being drawn one-pixel-too-high?
 

RadJunk

Administrator
Staff member
Gotcha. And specifically one pixel higher, correct? If I'm not mistaken, that is simply a NES thing, that there is a one pixel offset for drawing sprites. But it's super easy for me to fix by adding one pixel to the draw offset for every sprite. Just never had the need. I'll run some tests. :)
 

RadJunk

Administrator
Staff member
Consider this problem fixed. It was actually the opposite - I was correct. NES sprites are drawn with one pixel offset in the y value. I just made sure that every sprite's offset ends up one less than its declared position. This solved the problem. Sprites now line up perfectly with the background tiles without that one pixel offset.
 
Top Bottom