Programming Projects To Be Submitted By The Due Date
Programming Projects Shall Be Submitted By The Date Dueitems Turned
In this project, you will create a graphical simulation of an aerial dogfight game, which involves multiple classes and objects representing aircraft, projectiles, and the battle environment, using the StdDraw library for graphics. Your project must include a friendly aircraft controlled by user commands and multiple enemy aircraft attempting to destroy the player’s aircraft either by collision or firing projectiles. The simulation continues until all enemies are destroyed, the friendly aircraft is destroyed, or the user opts to quit. You will implement classes with inheritance, polymorphism, abstract classes, and collections such as ArrayLists, alongside controlling the game through an execution class.
Paper For Above instruction
The core of this project is to develop an interactive, graphical aerial dogfight simulation leveraging object-oriented programming principles. The goal is to design an engaging game where a user controls a friendly fighter aircraft to defend against or destroy attacking enemy aircraft, all within a visually simulated battlefield created using the StdDraw library authored by Princeton University.
The initial step involves designing a class hierarchy beginning with a top-level class, DogfightObject, which encapsulates common attributes such as position, size, and perhaps orientation for all objects in the simulation, grounded on inheritance principles. Building upon this, an abstract base class AerialObject is to be created, serving as a foundation for specific aerial entities like enemy fighters, friendly fighters, and projectiles. These classes will embody polymorphism, allowing flexible handling of different object types within collections or during interactions.
The FriendlyAircraft class must respond to user commands—moving vertically along the left edge, firing projectiles, and enabling full-range movement across the battlefield, including left, right, up, and down. The aircraft's movement must be responsive to keyboard inputs such as arrow keys and specific firing keys. Its visual representation should be realistically scaled and colored using StdDraw functions.
Enemy aircraft, instantiated with random vertical positions at the right edge of the window, will traverse leftward with semi-random diagonal movement, changing direction upon reaching top or bottom bounds. They can optionally fire missiles, which, if they hit the friendly aircraft, end the game with the player's defeat. Enemy behaviors should include dynamic movement, collision detection, and optional firing, all encapsulated within the EnemyAircraft class.
Projectiles, instantiated when either the friendly or enemy aircraft fire, travel in specified directions determined at firing time. These objects must display their trajectory trail and include collision detection capabilities to destroy enemy aircraft or the friendly aircraft upon impact. The Projectile class must encapsulate attributes like position, velocity, and active state, and provide methods for movement and rendering.
The BattleSpace class will serve as the container managing all in-game objects—adding, removing, updating, and rendering them. It will maintain collections of AerialObjects (and possibly GroundObjects for extra credit) using ArrayLists, iterating over them with enhanced for-loops for simulation updates and drawing routines. This class facilitates game state management and is central to coordinating all objects’ behaviors during the simulation loop.
The main execution class, AerialDogfight, will initialize the game, manage the game loop, process user inputs, update object states, and determine end-of-game conditions. It provides a concise main method, with the bulk of the game logic encapsulated in helper methods such as run(), to ensure clarity and separation of concerns. The game should display real-time statistics, such as destroyed enemies count, and provide score feedback through dialog boxes upon completion.
Additional features to enhance your project, if time permits, include implementing scenery objects (rocks, trees), adding aerial artillery units with autonomous or user-controlled firing, preventing aircraft overlap, and full-range movement for the friendly aircraft. All code must be well-documented with JavaDoc, adhere to established style guidelines, and demonstrate proper encapsulation and inheritance. Your UML diagrams should accurately depict the class hierarchy and interactions.
Your final submission should include all source code files with appropriate documentation, UML diagrams, a screenshot of the running game, and be submitted via Blackboard before the deadline. Extra features may earn additional points and demonstrate your understanding of advanced object-oriented design in Java, along with graphical programming and game development fundamentals.
References
- Princeton University. (n.d.). StdDraw documentation. Retrieved from https://introcs.cs.princeton.edu/java/stdlib/StdDraw.java.html
- Oracle. (2023). Java Documentation. https://docs.oracle.com/en/java/javase/17/docs/api/
- Gamma, E., Helm, R., Johnson, R., & Vlissides, J. (1994). Design patterns: Elements of reusable object-oriented software. Addison-Wesley.
- Bloch, J. (2018). Effective Java (3rd ed.). Addison-Wesley.
- Gaddis, T. (2018). Starting Out with Java: From Control Structures through Data Structures. Pearson.
- Heller, J. (2000). Java 2: A Beginner’s Guide. McGraw-Hill.
- Lee, K., & Tepfenhart, W. (2011). UML 2 and the Unified Process: Practical Object-Oriented Analysis and Design (2nd ed.). Addison-Wesley.
- Siemens, M. (2002). Introduction to Java Programming, Comprehensive Version. McGraw-Hill.
- Kruchten, P. (2003). The Rational Unified Process: An Introduction. Addison-Wesley.
- Fowler, M. (2003). Patterns of Enterprise Application Architecture. Addison-Wesley.