Amaraticando

Untitled

Mar 6th, 2025
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.83 KB | None | 0 0
  1. function display()
  2.     for id = 0, 23 do
  3.         local base = 0x0de2 + id * 94
  4.         local sprite_number = u16(base)
  5.         local xpos = u16(base + 0x06)
  6.         local ypos = u16(base + 0x0a)
  7.  
  8.         if sprite_number == 0x1e0 then
  9.             local sub_action = u8(base + 0x1d)
  10.             local action = u16(base + 0x2e)
  11.             local pointer = u16(base + 0x3c)
  12.  
  13.             -- proximity
  14.             local width = u8(base + 0x4c) - 1
  15.             local height = 0x29 * 2 - 1
  16.             local border = action == 0 and 0x40ff0000 or 0x60ffffff
  17.             local bg = action == 0 and 0xa0ff0000 or 0xd0ffffff
  18.             local xend = (xpos - width) + 2 * width
  19.             xend = math.min(xend, 879) - Camera_x
  20.             local yend = 2 * height
  21.             draw.box((xpos - Camera_x - width), (ypos - Camera_y - height), xend, yend, border, bg)
  22.         end
  23.         draw.pixel(xpos - Camera_x, ypos - Camera_y - 1, 0xffffff, 0x60000) -- interaction with tiles
  24.     end
  25. end
Advertisement
Add Comment
Please, Sign In to add comment