I’ve never made a shooting game, but heres how I’d do it:
First, I’d need to find the coordinates of the mouse. I’m pretty sure theres a built in method to do this, but since I don’t know it, I’d probably just have an invisible object follow the mouse by using the method startDrag(invisibleObject, true); and take the _x and _y from this object.
Next what I’d do is find the difference between the man’s coordinates and the mouses’s coordinates. You can rotate a MovieClip by using movieClip._rotation where rotation is the number of degrees you want to rotate it from the previous position. I can’t think of a formula to do this at the moment, you can probably find one online via google, or you could work it out by hand, or wait and see if another fourmer knows.
Next you need to do shooting. I personally am lazy and would probably make all of my guns hitscan, which means that as soon as you click, it checks to see if you hit an object and automatically does damage. Since you want to do it like that halo example, I’ll show you how to do it the other way (logically of course, you’ll have to figure out the code yourself).
You need to create a bullet movieclip for everytime the mouse is clicked. I cannot remember at the moment the method for when a mouse button is clicked (once again, google it. Its there) but basically once the mouse is clicked you want to create a new instance of a bullet object using the method:
root.attachMovie(“Bullet”, "Bullet"+root.getNextHighestDepth(), _root,getNextHighestDepth);
Then, in your bullet class you want to make the _x and _y move at an angle toward where the mouse is. I’d suggest using vectors and calculating the speed at which the x and y variables need to change by deviding the position of the man by the position of the mouse.
To hit people, it should now be easy to just use a hitTest with the bullet object on each different enemy object.
To pick up a weapon should be just as easy. Just do this:
if (root.man.hitTest(root.gun)) {
ownGun=true;
_root.man.gotoAndStop(2);
_root.gun.removeMovieClip();
}
Where man’s 2nd frame is him with the gun.
And thats really it. You can learn how to do some more basic stuff like movement and such by checking out the Shootorials here on Kongregate. Good luck with your game Fribox!
EDIT: Check out this thread for more help on rotations: http://www.kongregate.com/forums/4/topics/48148