I am having some trouble with this piece of my code
VARIABLES
health = 100
enemyhealth = 50
attack_chance = rnd(5)+1
attack = rnd(9)+1
battle_screen:
cls
text 0, 100, "Enemy Health..." + str$(enemyhealth)
text 0, 120, "Health..." + str$(health)
print "You are being attacked."
print "1.)Attack"
input battle$
repeat
if battle$ = "1"
if attack_chance>2
cls
dec enemyhealth, attack
text 0,100,"Enemyhealth..." + str$(enemyhealth)
text 0, 120, "Health..." + str$(health)
gosub battle_screen
endif
if attack_chance<2
cls
dec health, 3
text 0,100,"Enemyhealth..." + str$(enemyhealth)
text 0, 120, "Health..." + str$(health)
gosub battle_screen
endif
endif
until enemyhealth<1 or health<1
return
becauase once the enemies life or the player's life goes to zero or below it keeps going until you justpress enter.
Also when your in battle if you don't press a number before you press enter it freezes.