- Better life lost scene
This commit is contained in:
6
abad.lua
6
abad.lua
@@ -2,7 +2,7 @@
|
||||
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}}
|
||||
abad={x=40,y=24,flip=false,frame=1,wait=0,hab=10,vides=3,energia=40,falling=0,step=0,draw=abad.draw,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}}
|
||||
abad.update=abad_state_normal
|
||||
abad.objects={}
|
||||
|
||||
@@ -26,7 +26,7 @@ function abad_make_safe()
|
||||
end
|
||||
|
||||
function abad_hurt(howmuch)
|
||||
if not abad.hurting then
|
||||
if abad.hurting == 0 then
|
||||
abad.energia=abad.energia-howmuch
|
||||
if abad.energia<=0 then
|
||||
abad.vides=abad.vides-1
|
||||
@@ -38,7 +38,7 @@ function abad_hurt(howmuch)
|
||||
abad.hab=abad.safe.hab
|
||||
abad.x=abad.safe.x
|
||||
abad.y=abad.safe.y
|
||||
abad.hurting=10
|
||||
abad.hurting=60
|
||||
cls(3)
|
||||
end
|
||||
else
|
||||
|
||||
10
main.lua
10
main.lua
@@ -201,7 +201,7 @@ function update_game()
|
||||
rect(tx,ty,tx+8,ty+8,3)
|
||||
end
|
||||
else
|
||||
if not abad.hurting then
|
||||
if abad.hurting == 0 then
|
||||
draw_hab(abad.hab,0,0)
|
||||
--text(abad.hab,1,1,2)
|
||||
draw_hab(cameras[current_camera].hab,0,48)
|
||||
@@ -211,6 +211,14 @@ function update_game()
|
||||
setsource(tiles)
|
||||
prnt("x"..abad.vides,114,13,2)
|
||||
rectfill(102+(abad.energia>>1),30,122,37,16)
|
||||
else
|
||||
sspr(0,0,16,9,50,40,16,9,true)
|
||||
if abad.hurting > 40 then
|
||||
prnt("x"..abad.vides+1,63,43,3)
|
||||
elseif abad.hurting < 20 then
|
||||
prnt("x"..abad.vides,63,43,2)
|
||||
end
|
||||
end
|
||||
|
||||
mapa_update(abad.hab,cameras[current_camera].hab)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user