Both, actually. Mr. Evgenii is my teacher, and he asked this question on my behalf, so I will be the one responding.
When the character “hits” the arrow, I want the score counter to change. I tried to use the if (hits) command, but I wasn’t able to understand how it works. The original was:
if (this.hits(that)) {
//Do Something!
}
And the way I did this was:
if (mainCharacter.hits(arrow)) {
//project.score += 1;
}
And yet, it just says error for me and doesn’t let me play. The playable character is titled as “mainCharacter”, and the obstacles coming at the playable character are called “arrows”. If there is anything I’m doing wrong, I would be really grateful for you to point out what.
Also, if it isn’t too much trouble, if you do find out a code that works, will you be able to send it to this thread? If there are any more clarifications, I’m ready to respond as soon as possible.