I'm trying to make a function that could, for example, make a character face down.
This with the following (working!) code in it:
cName.FaceLocation(cName.x, cName.y+10);
In which cName ofcourse stands for the characters name.
I want to replace this 'cName' with a string inside the function.
How to do this?
I couldn't find much about the use of strings (in functions).
I don't think this will work, but it's as far as I could get:
function facedown(string charactername) {
charactername.FaceLocation(charactername.x, charactername.y+10);
}
How do I make this code working?
Best would be if I could make a function compatible with instances. This would result in cName.FaceDown();
Is that possible?
This with the following (working!) code in it:
cName.FaceLocation(cName.x, cName.y+10);
In which cName ofcourse stands for the characters name.
I want to replace this 'cName' with a string inside the function.
How to do this?
I couldn't find much about the use of strings (in functions).
I don't think this will work, but it's as far as I could get:
function facedown(string charactername) {
charactername.FaceLocation(charactername.x, charactername.y+10);
}
How do I make this code working?
Best would be if I could make a function compatible with instances. This would result in cName.FaceDown();
Is that possible?