Quantcast
Channel: nesdev.org
Viewing all articles
Browse latest Browse all 746

Issue figuring out how to check position in tilemap

$
0
0
Hi, I'm playing around with this thing, and I'm trying to figure out of the tile above the player is clear to move into. I'm checking each 8x8 tile, instead of treating each 16x16 block of tiles as combined units.

What I'm doing is figuring out the player's row and column by dividing their y and x coordinates by 8. The part where I'm running into trouble is when I try to check the space above my character. The way I'm checking is by subtracting 1 from the players row and multiplying it times 16 (I'm trying to jump up to the next row in the table, but I probably have the number wrong).

The problem with this is that it recognizes the top of the blocks around it, but prevents the player from moving up past any block to the side of it. What am I doing wrong here?
bm_background1.zip

bg_attr.asm

bm.chr

test1.asm

test1.nes

Statistics: Posted by sneed_generator — Sun May 05, 2024 6:27 pm — Replies 2 — Views 133



Viewing all articles
Browse latest Browse all 746

Trending Articles