I'm not exactly sure what the set up of your game is like, so this is just a basic script:
When the sprite touches the bullet sprite, it will hide, and change the players score by 1. Next, I set it to go to a random place on the screen.
Hope that helps!
Offline
This (I'm virtually certain, I extensively tested it) works:
If the rifle is "hitting" even if it isn't pointed at the character, make the 10 smaller. If the rifle isn't "hitting" even if it is pointed at the character, make then 10 larger.
Looks like the image got compressed. Right click+view to see the full size.
That is kind of advanced, so don't worry if you don't understand it. Basically, I'm using the arctan function to figure out the direction of the player relative to the rifle, and then comparing it to the direction of the rifle.
Last edited by Lar-Rew (2011-11-24 15:06:16)
Offline
Garr8 wrote:
i tried it but instead of the guy dying he goes flying all over the place
In Lar-Rew's script, when he dies, he goes to a random place on the screen. You could possible tweak the code so that when he dies, he hides for a second, and then goes to a random place on the screen.
Offline