Image

There are multiple ways of making a 360º aim and shoot engine, and i'll show you the (in my opinion) easier way of doing this.
It does not require any particular skill to accomplish but you'll need to know some maths to edit and perfect your engine, and how to make a custom movement.


Aim

The aim is based around the advanced direction object. Set it to 360 degrees as active objects cannot be rotated to any more than that. Now create an active object representing an arm holding a gun.

Right dir hotspot:
Image

Right dir action point:
Image

Left dir hotspot:
Image

Left dir action point:
Image

Leave the rest of the directions open.

I'm too lazy to draw a character so i'll just make a mask. This is supposed to be your character. It must have a custom movement!!. Remember that his arm is an object itself so don't draw it! Instead set the hotspot at the shoulder, where the arm is going to be attatched

Here comes the code:

+Always
-Set angle of ("Arm") to (Longdir ("Advanced direction object"), X("Arm")(Action point), Y("Arm")(Action point), Xmouse, Ymouse) at maximum speed
-Set Xposition of arm to ("Character")
-Set Yposition of arm to ("Character")

+Angle of ("Arm") is less than 90
OR
+Amgle of ("Arm") is greater than 270
-Set direction of ("Arm") to right
-Set direction of ("Character") to right

+Angle of ("Arm") is greater than 90
+Angle of ("Arm") is less than 270
-Set direction of arm to left
-Set direction of ("Character") to left




Shooting


For this section, all you need is to make a bullet. Set the hot spot and action point to left/center.

+Upon pressing left mouse button
-Create ("Bullet") at (0,0) from ("Arm")
-Set angle of ("Bullet") to (Angle ("Arm"))
-Set Alterable value a ("Bullet") to Xposition ("Bullet")
-Set Alterable value b ("Bullet") to Yposition ("Bullet")


+Always
-Add Cos(Angle("Bullet"))*10 to Alterable value a ("Bullet")
-Add Sin(Angle("Bullet"))*-10 to Alterable value b ("Bullet")
-Set Xposition ("Bullet") to Alterable value a ("Bullet")
-Set Yposition ("Bullet") to Alterable value b ("Bullet")




THAT'S IT!

REport eventual bugs in the comments, here is the example file, but I had to make it in an old build of mmf2 so it's not bug-free.
http://cid-60e7c0854843dd48.skydrive.live.com/self.aspx/Offentlig/360div.mfa