I made an attack button that will subtract a random range of 1-2 from the enemys HP and I displayed the Enemys HP as a text above him. It shows the initial 10 but after I press the attack button the number disappears.
I think when you subtract random 1-2 from HP, it changes to float number and the textbox is not enough width to contain all the number and it got line break, so it out of the textbox.
You need to round(random(1,2)) or make it shorter.
Develop games in your browser. Powerful, performant & highly capable.
It works! I rounded the Enemy1.HP after it subtracts. Thank you.