my variable is "objectHeight"+i
depending on what i is the variable becomes
objectHeight1
objectHeight2
objectHeight3
etc
the problem is that its not registering as a variable
edit:
by variable becomes i don't mean what its equal to but the name of the variable.
Ignore the top and the title. I'm gonna try to explain it the best i can now.
Lets say im trying to make a "targeting" system for a rpg game or something.
instead of doing that for every enemy i want to do something like this. (obvoiusly it's not correct)PHP Code:if (target == 1){
enemy_hp1 -= 20
}
if (target == 2){
enemy_hp2 -= 20
}
PHP Code:["enemy_hp"+target] -=20




Reply With Quote