Hello,
i am attempting to combine footstep sounds with an Animation like so:
def animWalk(self):
def sfx():
print('footstep')
self.footstep.play()
w1 = Func(self.charM.loop, 'walk', fromFrame=1, toFrame=8)
footstep=Func(sfx)
w2=Func(self.charM.play, 'walk', fromFrame=9, toFrame=16)
if self.walkseq==None:
self.walkseq = Sequence(w1,footstep, w2)
# if self.walkseq.isPlaying()!=True:
if self.anim!="walk":
self.walkseq.start()
With this, however, it only plays the sfx and loops the second part of the animation, completely skipping over w1
.
Printing getCurrentFrame()
shows that it plays from frame 9 to 16, then None before playing the sfx and starting over again(from frame 9).