- Music included
- Audio ongoing
This commit is contained in:
12
abad.lua
12
abad.lua
@@ -1,8 +1,8 @@
|
||||
|
||||
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}}
|
||||
abad={x=40,y=24,flip=false,frame=1,wait=0,hab=10,vides=3,energia=40,falling=0,step=0, mustep=1,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,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={x=40,y=24,flip=false,frame=1,wait=0,hab=10,vides=3,energia=40,falling=0,step=0,mustep=1,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={}
|
||||
|
||||
@@ -74,6 +74,7 @@ function abad_state_normal()
|
||||
abad.update=abad_state_jumping
|
||||
abad.step=0
|
||||
abad.jumpfwd=false
|
||||
playchirp(audio_abad_jump)
|
||||
elseif btn(KEY_DOWN) then
|
||||
abad.update=abad_state_crouch
|
||||
elseif btnp(KEY_SPACE) and cacau.hab==-1 then
|
||||
@@ -143,6 +144,11 @@ function abad_state_walking()
|
||||
if abad.wait==6 then
|
||||
abad.wait=0
|
||||
abad.step=(abad.step+1)%4
|
||||
if abad.step==0 then
|
||||
playchirp(audio_abad_step[abad.mustep])
|
||||
abad.mustep = abad.mustep + 1
|
||||
if abad.mustep == 5 then abad.mustep=1 end
|
||||
end
|
||||
abad.frame=abad.anim[abad.step+1]
|
||||
|
||||
abad_advance()
|
||||
@@ -159,6 +165,7 @@ function abad_state_walking()
|
||||
abad.update=abad_state_jumping
|
||||
abad.step=0
|
||||
abad.jumpfwd=true
|
||||
playchirp(audio_abad_jump)
|
||||
return
|
||||
elseif btn(KEY_DOWN) then
|
||||
abad.update=abad_state_crouch
|
||||
@@ -220,6 +227,7 @@ function abad_state_jumping()
|
||||
end
|
||||
elseif abad.step>6 then
|
||||
abad.update=abad_state_falling
|
||||
playchirp(audio_abad_fall)
|
||||
end
|
||||
abad.step=abad.step+1
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user