Posts for vogosvagen

Joined: 11/1/2015
Posts: 2
Thank you both, I won't say I understand how it works 100% but what you said definitely helped. I'm trying to understand the algorithm now. Taking it nice and slow.
Joined: 11/1/2015
Posts: 2
Hey Dwood15, I found a comment of yours on reddit, and found my self stumbling here. I'm currently going through the source code, and I'm having a bit of trouble understanding what the getTile(dx,dy) function does. From what I've gathered, it determines where mario is (page o, or page 1. As in a level contains 2 pages?), and determines which Tile is active(?). I'm talking about this part (super mario bros. part of the code):
Language: lua

local subx = math.floor((x%256)/16) local suby = math.floor((y - 32)/16) local addr = 0x500 + page*13*16+suby*16+subx if suby >= 13 or suby < 0 then return 0 end if memory.readbyte(addr) ~= 0 then return 1 else return 0 end
is there anyone who documented/commented over the source code?