From c0a7eb1ee20de976e2472b83a2f4a9414f0ed5a5 Mon Sep 17 00:00:00 2001 From: djib Date: Thu, 11 Nov 2021 23:16:43 +0100 Subject: [PATCH] Pyranas can now eat their fellow pyranas --- pyras.p8 | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/pyras.p8 b/pyras.p8 index 0e6bbc8..8fb5c15 100644 --- a/pyras.p8 +++ b/pyras.p8 @@ -11,10 +11,12 @@ end function _update() movepyras() moveguy() + eatpyras() end function _draw() cls() + print(#pyras,7) drawguy() drawpyras() end @@ -40,8 +42,11 @@ end pyras={} function initpyras() - for i=1,10 do - pyras[i]={x=rnd(128),y=rnd(128)} + for i=1,50 do + pyras[i]={ + x=flr(rnd(128)), + y=flr(rnd(128)) + } end end @@ -59,6 +64,21 @@ function movepyras() if (pyra.y