I'd really remake that ged if I were you. It'd be good learning experience. You created at least 20 unnecessary actors, and use textNumber and text in ways that you shouldn't rely on. I think partially because of that, you have your problem. Now, here is how you should convert text into a number.
- Code: Select all
int var = atoi(string_var);
In your case, you would have something like this.
- Code: Select all
levelNo = atoi(numberIndicator.text);
Now, if you have a lot of actors that do essentially the same thing, you can use cloneindex to differentiate them. So, I'd create one button actor, and have the cloneindex determine which character to strcat.
button -> Mouse Button Down (left) -> Script Editor
- Code: Select all
switch(cloneindex)
{
case 0:
strcat(numberIndicator.text, "0");
break;
// one for each cloneindex
}
You could even use the cloneindex to get the proper characters, and avoid making a case for each cloneindex. In that case, you'd have only a default case, and one for backspace.