I'm having trouble with a small piece of code.
- Code: Select all
shieldHealth += Math.round(Math.random()*50);
if (shieldHealth > 200000)
{
shieldHealth = 200000;
}
shield.x = player.x;
shield.y = player.y;
inter_face.shieldText.text = shieldHealth + "/ 200000";
shield.alpha = (shieldHealth / 200000);
inter_face.shieldBar.width = shield.alpha * 150;
This one is it.
Its not throwing errors or anything, it just lags hard (actualization rate goes from 37 to 22...).
Hope anyone can tell me why, Im clueless...
Best regards