ok im having trouble making a player score. on tutorials it says u have to make a dynamic edit box but i dont know how to make the edit box dianamic. so thats my first question.
second, this isnt a button pressing game like all the turtorials have, i want, after my sword collides with my clones badguys, i want the score to go up,
so here is my script:
for (i=0;i<num_badguy;i++) {
if (element ("Sword").collideRect (badguy[i])) {
but sence the edit box isnt dynamic, my every time i kill a badguy my score just adds a 10 to it like this, if i kill 5 badguys it appears like this : 1010101010, which it really should be 50, so maybe my script is wrong, but im not sure how to make the edit box dynamic.
ok, I have no idea what your script is all about but i can tell you how i do it. I would make an edit box and name it "score" lets say. (by the way make sure you name it under "varible" in the edit box instead of just the name of the edit box or it wont work, its under the "initialize with text" box). Then I would say
if (element ("Sword").collideRect (badguy[i])){
score+=10
}
ofcourse it will add 10 for every frame that the sword collides with your badguy, so your gona wanna make a code saying "if collide then hide badguy" and then youll have to make anither code saying, "if badguy hidden then dont add 10" or something
but when i am attacking my badguys, i am removing the clone from the movie not hiding them, so i dont see what your saying. ill include a file maybe u can show me, because i am really confused.
nevermind what i said, i just kno i used to have problems with clones but if it works i guess its fine, here i fixed it and explained why in the collision script, i think it was because you need to set the editbox to a number first in the starting script
every time i kill a badguy my score just adds a 10 to it like this, if i kill 5 badguys it appears like this : 1010101010, which it really should be 50, so maybe my script is wrong, but im not sure how to make the edit box dynamic.
thanks
Hi.
For anyone else reading this and wondering, the reason is because the variable was being treated as a text variable and not a numeric variable.
So if you say "10"+"10" the answer is "1010" but if you say 10+10 the answer is 20. It doesn't sound like there's a problem with the edit box itself.