From 2ce7908ce89ba8c25493aee394c5b77246863731 Mon Sep 17 00:00:00 2001 From: djib Date: Thu, 11 Nov 2021 22:09:13 +0100 Subject: [PATCH] Adding basic pyra movement --- pyras.p8 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pyras.p8 b/pyras.p8 index 9871958..91b24f2 100644 --- a/pyras.p8 +++ b/pyras.p8 @@ -9,6 +9,7 @@ function _init() end function _update() + movepyras() moveguy() end @@ -48,6 +49,15 @@ function drawpyras() pset(pyra[1],pyra[2],8) end end + +function movepyras() + for pyra in all(pyras) do + if (pyra[1]>guyposx) pyra[1]-=1 + if (pyra[1]guyposy) pyra[2]-=1 + if (pyra[2]