same as previous

This commit is contained in:
2022-12-05 17:56:40 +01:00
parent 5bb3d3457b
commit 1b2d180e17

View File

@@ -1,5 +1,5 @@
abad={x=40,y=24,flip=false,frame=1,wait=0,hab=10,vides=3,energia=40,falling=0,step=0,update=nil,jumpfwd=false,anim={0,1,0,2},bb={x=4,y=0,w=8,h=16},safe={hab=10,x=40,y=24}} abad={x=40,y=24,flip=false,frame=1,wait=0,hab=10,vides=3,energia=40,falling=0,step=0,hurting=0,update=nil,jumpfwd=false,anim={0,1,0,2},bb={x=4,y=0,w=8,h=16},safe={hab=10,x=40,y=24}}
function abad_init() function abad_init()
abad={x=40,y=24,flip=false,frame=1,wait=0,hab=10,vides=3,energia=40,falling=0,step=0,draw=abad.draw,update=nil,jumpfwd=false,anim={0,1,0,2},bb={x=4,y=0,w=8,h=16},safe={hab=10,x=40,y=24}} abad={x=40,y=24,flip=false,frame=1,wait=0,hab=10,vides=3,energia=40,falling=0,step=0,draw=abad.draw,update=nil,jumpfwd=false,anim={0,1,0,2},bb={x=4,y=0,w=8,h=16},safe={hab=10,x=40,y=24}}
@@ -21,11 +21,12 @@ function abad_make_safe()
abad.safe.hab=abad.hab abad.safe.hab=abad.hab
abad.safe.x=abad.x abad.safe.x=abad.x
abad.safe.y=abad.y abad.safe.y=abad.y
cls(4) --cls(4)
end end
end end
function abad_hurt(howmuch) function abad_hurt(howmuch)
if not abad.hurting then
abad.energia=abad.energia-howmuch abad.energia=abad.energia-howmuch
if abad.energia<=0 then if abad.energia<=0 then
abad.vides=abad.vides-1 abad.vides=abad.vides-1
@@ -37,11 +38,13 @@ function abad_hurt(howmuch)
abad.hab=abad.safe.hab abad.hab=abad.safe.hab
abad.x=abad.safe.x abad.x=abad.safe.x
abad.y=abad.safe.y abad.y=abad.safe.y
abad.hurting=10
cls(3) cls(3)
end end
else else
cls(3) cls(3)
end end
end
end end
function abad_state_normal() function abad_state_normal()
@@ -49,6 +52,9 @@ function abad_state_normal()
abad.wait=0 abad.wait=0
abad.step=0 abad.step=0
abad.jumpfwd=false abad.jumpfwd=false
if abad.hurting > 0 then
abad.hurting=abad.hurting-1
end
if abad.falling>0 then if abad.falling>0 then
if abad.falling>12 then if abad.falling>12 then