I want to have a delay between each shot or maybe a limited bulled number and then a reload time.
def input (key):
if key == 'space':
e = Entity(y=zeri.y, x=zeri.x+2, model='quad', collider='box', texture="textures/bum.png")
e.animate_x(30, duration=2, curve=curve.linear)
invoke(destroy, e, delay=2)
This is the bullet code.
I tried by using time.sleep()
and expected it to stop the player from using commands but it just stops everything.
For the bulled reload I tried:
def input (key):
bullets=10
if key == 'space' and if bullets>0:
e = Entity(y=zeri.y, x=zeri.x+2, model='quad', collider='box', texture="textures/bum.png")
e.animate_x(30, duration=2, curve=curve.linear)
invoke(destroy, e, delay=2)
bullets=bullets-1
I expected it to stop shooting after 10 bullets, but you can still shoot for as long as you want.