Browse Source

Messing around

spesk1 4 years ago
parent
commit
32be78b9be
3 changed files with 123 additions and 2 deletions
  1. 64 0
      auto.p8
  2. 51 0
      box_grow.p8
  3. 8 2
      color_noise.p8

+ 64 - 0
auto.p8

@@ -0,0 +1,64 @@
+pico-8 cartridge // http://www.pico-8.com
+version 18
+__lua__
+
+cell = {
+  x = 64,
+  y = 64,
+  c = 0,
+  size = 1,
+}
+
+function pset2(x,y,col)
+  color = pget(x,y)
+  rcol = rnd(15) + 1
+  if ( color == col ) then
+    rcol += 1
+  end
+  pset(x,y,rcol)
+end
+
+function draw_cell()
+  cf = rnd(1) + 1
+  if ( cf > 1.5 ) then 
+    cell.size += 1
+  else
+    cell.size -= 1
+  end
+
+  gx = cell.x + cell.size
+  gy = cell.y + cell.size
+  for cx=cell.x,gx do 
+    for cy=cell.y,gy do
+      pset2(cx,cy,1+rnd(9))
+    end
+  end
+end
+    
+
+function fps()
+  f = stat(7)
+  print("fps: "..f,0,120,1)
+end
+
+function _init()
+  cls()
+end
+
+function _update()
+  cls()
+  fps()
+end
+
+function _draw()
+  draw_cell()
+  cell.c += 1
+end
+
+__gfx__
+00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+00700700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+00077000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+00077000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+00700700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

+ 51 - 0
box_grow.p8

@@ -0,0 +1,51 @@
+pico-8 cartridge // http://www.pico-8.com
+version 18
+__lua__
+
+cell = {
+  center = 64,
+  startx = 64,
+  endx = 64,
+  starty = 64,
+  endy = 64,
+}
+
+function draw_loop(startx,endx,starty,endy)
+  for dx=startx,endx do
+    for dy=starty,endy do
+      pset(dx,dy,1+rnd(15))
+    end
+  end
+end
+
+function derive_bounds(i)
+  cell.startx -= i
+  cell.starty -= i
+  cell.endx += i
+  cell.endy += i   
+end
+
+function _init()
+  cls()
+end
+
+function _update60()
+  cls()
+end
+
+function _draw()
+  draw_loop(cell.startx,cell.endx,cell.starty,cell.endy)
+  r = rnd(20)
+  if ( r > 19 ) then
+    derive_bounds(1)
+  end
+end
+
+
+__gfx__
+00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+00700700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+00077000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+00077000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+00700700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

+ 8 - 2
color_noise.p8

@@ -2,13 +2,19 @@ pico-8 cartridge // http://www.pico-8.com
 version 18
 __lua__
 
+function fps()
+  f = stat(7)
+  print("fps: "..f, 0, 120, 1)
+end
+
 cls()
 while 1 do
-for x=0,119 do
-  for y=0,119 do
+for x=0,95 do
+  for y=0,95 do
     r = rnd(9)
     if (r > 8) then
       pset(x,y,1+rnd(9))
+      fps()
     end
   end
 end