same as previous
This commit is contained in:
10
abad.lua
10
abad.lua
@@ -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()
|
||||
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.x=abad.x
|
||||
abad.safe.y=abad.y
|
||||
cls(4)
|
||||
--cls(4)
|
||||
end
|
||||
end
|
||||
|
||||
function abad_hurt(howmuch)
|
||||
if not abad.hurting then
|
||||
abad.energia=abad.energia-howmuch
|
||||
if abad.energia<=0 then
|
||||
abad.vides=abad.vides-1
|
||||
@@ -37,11 +38,13 @@ function abad_hurt(howmuch)
|
||||
abad.hab=abad.safe.hab
|
||||
abad.x=abad.safe.x
|
||||
abad.y=abad.safe.y
|
||||
abad.hurting=10
|
||||
cls(3)
|
||||
end
|
||||
else
|
||||
cls(3)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function abad_state_normal()
|
||||
@@ -49,6 +52,9 @@ function abad_state_normal()
|
||||
abad.wait=0
|
||||
abad.step=0
|
||||
abad.jumpfwd=false
|
||||
if abad.hurting > 0 then
|
||||
abad.hurting=abad.hurting-1
|
||||
end
|
||||
|
||||
if abad.falling>0 then
|
||||
if abad.falling>12 then
|
||||
|
||||
Reference in New Issue
Block a user