box_grow.p8
1	pico-8 cartridge // http://www.pico-8.com
2 version 18
3 __lua__
4
5 cell = {
6 center = 64,
7 startx = 64,
8 endx = 64,
9 starty = 64,
10 endy = 64,
11 }
12
13 function draw_loop(startx,endx,starty,endy)
14 for dx=startx,endx do
15 for dy=starty,endy do
16 pset(dx,dy,1+rnd(15))
17 end
18 end
19 end
20
21 function derive_bounds(i)
22 cell.startx -= i
23 cell.starty -= i
24 cell.endx += i
25 cell.endy += i
26 end
27
28 function _init()
29 cls()
30 end
31
32 function _update60()
33 cls()
34 end
35
36 function _draw()
37 draw_loop(cell.startx,cell.endx,cell.starty,cell.endy)
38 r = rnd(20)
39 if ( r > 19 ) then
40 derive_bounds(1)
41 end
42 end
43
44
45 __gfx__
46 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
47 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
48 00700700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
49 00077000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
50 00077000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
51 00700700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000