From 34ec629a287514115bf409613aba5656a84e0ce9 Mon Sep 17 00:00:00 2001 From: djib Date: Mon, 29 Nov 2021 23:30:09 +0100 Subject: [PATCH] Size of characters can be changed by player --- pyras.p8 | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/pyras.p8 b/pyras.p8 index d2a87a5..dbfd61a 100644 --- a/pyras.p8 +++ b/pyras.p8 @@ -135,11 +135,25 @@ function updategame() game.tick+=1 if game.state==0 then if(btnp(❎))game.state=1 + if game.level==1 then + if(btnp(⬅️)) and game.pixelsize>1 then + game.pixelsize-=1 + initgame() + end + if(btnp(➡️)) and game.pixelsize<8 then + game.pixelsize+=1 + initgame() + end + end elseif game.state==1 then waitormove() if guy.dead then - game.state=3 - game.level=max(0,game.level-1) + if game.level>1 then + game.state=3 + game.level-=1 + else + game.state=4 + end sfx(1) elseif #pyras==1 then game.state=2 @@ -157,9 +171,14 @@ function drawgame() drawguy() drawandeatpyras() if game.state==0 then - cursor(48,61,7) + rectfill(46,46,80,80,5) + cursor(48,58,7) print "press ❎" print "to start" + if game.level==1 then + cursor(30,122,7) + print "⬅️ change size ➡️" + end elseif game.state>1 then cursor(46,61,7) print "game over" @@ -169,6 +188,9 @@ function drawgame() if game.state==3 then print "level down" end + if game.state==4 then + print "try again!" + end end end -->8