You can code two joysticks and decide its movement by the left joystick and decide attack direction with a right joystick or vice versa.