Browse Source

Size of characters can be changed by player

sprites
djib 2 months ago
parent
commit
34ec629a28
  1. 28
      pyras.p8

28
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

Loading…
Cancel
Save