fix offscreen sprites sometimes being visible

This commit is contained in:
Connor Olding 2018-06-08 15:03:09 +02:00
parent f576a47282
commit 431a591481
2 changed files with 2 additions and 4 deletions

View File

@ -7,8 +7,6 @@ TODOs: (that i can remember right now)
- settle on a network architecture
- detect frames when Mario is in a controllable state
- compute how many input neurons the network needs instead of hardcoding
- rewrite positions to be relative to Mario
'-> fix offscreen sprites sometimes being visible to network
- add some detection for enemies later in the game
- fix cfg.enable_overlay (smb.lua doesn't see it being changed)

View File

@ -88,9 +88,9 @@ local function set_timer(time)
end
local function mark_sprite(x, y, t)
if t == 0 then
if t == 0 or x <= -8 or x >= 0xFF or y <= 0 or y >= 0xE8 then
-- place unused/unseen sprites
x = -0x08 -- just off the left side of the screen
x = -8 -- just off the left side of the screen
y = 0xC8 -- at ground level.
end