auto.p8
1	pico-8 cartridge // http://www.pico-8.com
2 version 18
3 __lua__
4
5 cell = {
6 x = 64,
7 y = 64,
8 c = 0,
9 size = 1,
10 }
11
12 function pset2(x,y,col)
13 color = pget(x,y)
14 rcol = rnd(15) + 1
15 if ( color == col ) then
16 rcol += 1
17 end
18 pset(x,y,rcol)
19 end
20
21 function draw_cell()
22 cf = rnd(1) + 1
23 if ( cf > 1.5 ) then
24 cell.size += 1
25 else
26 cell.size -= 1
27 end
28
29 gx = cell.x + cell.size
30 gy = cell.y + cell.size
31 for cx=cell.x,gx do
32 for cy=cell.y,gy do
33 pset2(cx,cy,1+rnd(9))
34 end
35 end
36 end
37
38
39 function fps()
40 f = stat(7)
41 print("fps: "..f,0,120,1)
42 end
43
44 function _init()
45 cls()
46 end
47
48 function _update()
49 cls()
50 fps()
51 end
52
53 function _draw()
54 draw_cell()
55 cell.c += 1
56 end
57
58 __gfx__
59 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
60 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
61 00700700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
62 00077000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
63 00077000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
64 00700700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000