Unmanned combat aerial vehicles are expected to assist human pilots or to perform autonomous aerial combat in the future. Previous research studies on autonomous aerial combat often have limitations due to overly simplifying assumptions, heavy computational loads, and limited scalability. In this paper, we propose a novel autonomous aerial combat algorithm with high-performance and real-time calculations based on basic fighter maneuvers for gun-based engagement within visual range. From the perspective of energy maneuver, which is the core concept of basic fighter maneuvers, we analyzed the flight envelope and maximum maneuvering point of a fighter jet model using the velocity-load factor and energy-maneuver diagrams. We designed a score function and matrix for situation assessment based on combat geometries, enabling cooperative maneuvers and role assignment. By performing gun modeling and target prediction based on the maneuvering plane, the impact point for gun shooting was obtained. The performance of the designed algorithm was validated through not only Monte-Carlo simulations with various initial conditions, but also engagements with another algorithm for comparison, and evaluation sessions by an Air Force combat instructor in a real-time simulation environment using virtual reality goggles and X-Plane.