Copy link to clipboard
Copied
I'm currently trying to make a very simple game where the player can click an up or down arrow to move a spaceship while avoiding objects. I need to try and figure out what code to add in to add a game over state whenever the player runs into any objects that fly past. Ideally, I'd like to add some sort or scoring system too, but at the very least I want to detect when the ship collides with an item. I've tried looking at several different Youtube tutorials, but nothing has come close enough to solving my issue. Does anyone have a good resource they could point me to? Or, would you know what I should add into the code to make this work? Thank you
Copy link to clipboard
Copied
html5 or as3?
Copy link to clipboard
Copied
Hi.
If it's HTML5 Canvas:
- Use the localToLocal and the hitTest methods. Please check this tutorial for more info.
If it's AS3:
- Use the hitTestObject or hitTestPoint methods.
In both cases, you could just use a simple circle collision as well.
Please let us know if you need further assistance.
Regards,
JC