auto.p8 1.4 KB

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