I haven't coded since Macromedia, and god things have changed. I'm at a steep learning curve and trying to get back into it.
Im making a little flash game where the player collects tacos and the score goes up.
No code online that I have found for making collectable money works on Animate CC for me. I am unsure why that is. The script runs fine, debug detects nothing. But the code doesn't do anything.
I have tried this:
if(player.hitTestObject(taco1))
{
if(back.contains(taco1))
removeChild(taco1);
score += 10;
points.text = String(score);
}
which either doesnt collect the taco, or the taco follows the player (if I put it on the main scene.}
I've also tried just plugging in my instances in a code provided on AS3 game tutorials. It can be seen here, unaltered.
if(keyCollected == false){ // if we still haven't collected the key
if(player.hitTestObject(back.doorKey)){ // and if the player collides
with the key
back.doorKey.visible = false; // hide the key from view
keyCollected = true; // set our Boolean to true
}
}
none of this works either.
Sorry new to forum, and haven't coded in ten years. But any points in the right direction would be so helpful! Thank you!