Size of characters can be changed by player

This commit is contained in:
2021-11-29 23:30:09 +01:00
parent db259d49b1
commit 34ec629a28

View File

@ -135,11 +135,25 @@ function updategame()
game.tick+=1 game.tick+=1
if game.state==0 then if game.state==0 then
if(btnp(❎))game.state=1 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 elseif game.state==1 then
waitormove() waitormove()
if guy.dead then if guy.dead then
game.state=3 if game.level>1 then
game.level=max(0,game.level-1) game.state=3
game.level-=1
else
game.state=4
end
sfx(1) sfx(1)
elseif #pyras==1 then elseif #pyras==1 then
game.state=2 game.state=2
@ -157,9 +171,14 @@ function drawgame()
drawguy() drawguy()
drawandeatpyras() drawandeatpyras()
if game.state==0 then if game.state==0 then
cursor(48,61,7) rectfill(46,46,80,80,5)
cursor(48,58,7)
print "press ❎" print "press ❎"
print "to start" print "to start"
if game.level==1 then
cursor(30,122,7)
print "⬅️ change size ➡️"
end
elseif game.state>1 then elseif game.state>1 then
cursor(46,61,7) cursor(46,61,7)
print "game over" print "game over"
@ -169,6 +188,9 @@ function drawgame()
if game.state==3 then if game.state==3 then
print "level down" print "level down"
end end
if game.state==4 then
print "try again!"
end
end end
end end
-->8 -->8