Log In  

-- generate tile
srand(0x1b0f)
for y=0,7 do
 for x=8,15 do
  local c=flr(x/2)+y
  if(x%2==0) c+=rnd(2)-1
  sset(x,y,c%4)
 end
end

-- set map tiles
for y=0,15 do
 for x=0,15 do
  mset(x,y,1)
 end
end

-- display map
local t=0
function _update()
 t+=1
end
function _draw()
 palt(0,false)
 for i=0,3 do
  pal(i,flr(t/4)%4==i and 12 or 1)
 end
 map(0,0, 0,0, 16,16)
end

Cart #41801 | 2017-06-20 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
2

P#41802 2017-06-20 08:23 ( Edited 2017-06-20 19:35)

How do I apply the water effect to a specific area in the game???

P#91288 2021-04-29 11:02

The code generates some sprites then adds them to the map.

In that second part (mset) you can change the loops to do the rectangular area that you want, then change how map is called.

P#91313 2021-04-29 19:41

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-04-16 23:11:40 | 0.009s | Q:17