diff --git a/pyras.p8 b/pyras.p8 index 5af47a6..3d49ed5 100644 --- a/pyras.p8 +++ b/pyras.p8 @@ -18,10 +18,10 @@ guyspeedx=2 guyspeedy=2 function moveguy() - if (btn(0)) guyposx-=guyspeedx - if (btn(1)) guyposx+=guyspeedx - if (btn(2)) guyposy-=guyspeedy - if (btn(3)) guyposy+=guyspeedy + if (btn(0)) guyposx=max(0,guyposx-guyspeedx) + if (btn(1)) guyposx=min(127,guyposx+guyspeedx) + if (btn(2)) guyposy=max(0,guyposy-guyspeedy) + if (btn(3)) guyposy=min(127,guyposy+guyspeedy) end function drawguy()