The Quantum Avenger An Application of Object Oriented Design Principles in Game Development Andres Calderon Jaramillo - Dr. Hong K. Sung (Faculty Advisor)

Slides:



Advertisements
Similar presentations
QUICK QUIZ 23.1 (For the end of section 23.2)
Advertisements

The Kinetic Theory of Gases
Lecture 9 Review.
Kinetics of Particles Impulse and Momentum.
Chapter 4.2 Collision Detection and Resolution. 2 Collision Detection Complicated for two reasons 1. Geometry is typically very complex, potentially requiring.
Chapter 21. Electric Charge
Generated Waypoint Efficiency: The efficiency considered here is defined as follows: As can be seen from the graph, for the obstruction radius values (200,
Momentum Impulse, Linear Momentum, Collisions Linear Momentum Product of mass and linear velocity Symbol is p; units are kgm/s p = mv Vector whose direction.
Chapter 22 Electric Potential.
Using the “Clicker” If you have a clicker now, and did not do this last time, please enter your ID in your clicker. First, turn on your clicker by sliding.
UNC Chapel Hill S. Redon - M. C. Lin Rigid body dynamics II Solving the dynamics problems.
Physics 101: Lecture 15, Pg 1 Physics 101: Lecture 15 Impulse and Momentum l Today’s lecture will be a review of Chapters and l New material:
Frank L. H. WolfsDepartment of Physics and Astronomy, University of Rochester Physics 121. Tuesday, March 4, 2008.
Physics 111: Mechanics Lecture 11 Dale Gary NJIT Physics Department.
Gravitational Potential energy Mr. Burns
Gravity and Orbits The gravitational force between two objects:
Chapter 7 Potential Energy.
Lecture VII Rigid Body Dynamics CS274: Computer Animation and Simulation.
Design Patterns OOD. Course topics Design Principles UML –Class Diagrams –Sequence Diagrams Design Patterns C#,.NET (all the course examples) Design Principles.
Chapter 25 Electric Potential Electrical Potential and Potential Difference When a test charge is placed in an electric field, it experiences a.
KeyListener and Keyboard Events Just as we can implement listeners to handle mouse events, we can do the same for keyboard events (keypresses) –to implement.
Chapter 9: Rotational Dynamics
Essential Idea:  The Newtonian idea of gravitational force acting between two spherical bodies and the laws of mechanics create a model that can be.
1 Electric Potential Reading: Chapter 21 Chapter 21.
Electric Forces and Electric Fields
© 2007 Pearson Prentice Hall This work is protected by United States copyright laws and is provided solely for the use of instructors in teaching their.
Coulomb’s Law. Answer Me!!!  An inflated balloon which has been rubbed against a person’s hair is touched to a neutral wall and remains attracted to.
Today: Momentum – chapter 9 11/03 Finish momentum & review for exam 11/8 Exam 2 (5 – 8) 11/10 Rotation 11/15 Gravity 11/17 Waves & Sound 11/22 Temperature.
AP Physics C: Mechanics Chapter 11
Questions From Reading Activity? Big Idea(s):  The interactions of an object with other objects can be described by forces.  Interactions between.
Energy Transformations and Conservation of Mechanical Energy 8
Fields and Forces State Newton’s Law of gravitation Define gravitational field strength Determine the gravitational field due to one.
Neo-Breakout Sonhui Schweitzer CS 470 Spring 2005.
Energy Transformations and Conservation of Mechanical Energy 8.01 W05D2.
Chapter 8 Potential Energy. Potential energy is the energy associated with the configuration of a system of objects that exert forces on each other This.
Potential Energy ~March 1, 2006.
Final review Help sessions scheduled for Dec. 8 and 9, 6:30 pm in MPHY 213 Your hand-written notes allowed No numbers, unless you want a problem with numbers.
Few examples on calculating the electric flux
The product of mass and velocity of a body is called momentum. Force and Laws of Motion Momentum Mathematically, Momentum = mass × velocity P = mv It is.
Q20. Electric Charge Force and Field
AP Physics C Montwood High School R. Casao
Electrical Energy And Capacitance
Exam 2 Review 8.02 W08D1. Announcements Test Two Next Week Thursday Oct 27 7:30-9:30 Section Room Assignments on Announcements Page Test Two Topics: Circular.
Tribal Challenge Review Question! A satellite is in circular orbit 525km above the surface of the Earth. Determine the satellite’s (a) speed and (b) period.
Chapter 11 Angular Momentum. Angular momentum plays a key role in rotational dynamics. There is a principle of conservation of angular momentum.  In.
Modern Physics course (Phys 225) Chapter III : Introduction to atomic physics 1 الدكتور : قسم الفيزياء
Electric Fields. The gravitational and electric forces can act through space without any physical contact between the interacting objects. Just like the.
Momentum.
Chapter 13 Gravitation Newton’s Law of Gravitation Here m 1 and m 2 are the masses of the particles, r is the distance between them, and G is the.
Chapter 4 Rotation of rigid body §4.1 The rotation of a rigid body about a fixed axisThe rotation of a rigid body about a fixed axis §4.2 Torque, the law.
CS274 Spring 01 Lecture 7 Copyright © Mark Meyer Lecture VII Rigid Body Dynamics CS274: Computer Animation and Simulation.
Electric Potential.
Rick Parent - CIS682 Rigid Body Dynamics simulate basic physics of an object subject to forces Keyframing can be tedious - especially to get ‘realism’
Concept 2: Motions and Forces Analyze relationships between forces and motion. 1. Determine the rate of change of a quantity 2. Analyze the relationships.
 We learned about charge and got a conceptual feel for what it is.  We identified charge with the fundamental building clocks of atoms.  We studies.
Gravity 3/31/2009 Version. Consent for Participation in Research Construct Centered Design Approach to Developing Undergraduate Curriculum in Nanoscience.
1 Electric Potential Reading: Chapter 29 Chapter 29.
Impulse & Momentum Physics 11. Momentum  The product of a particle’s mass and velocity is called the momentum of the particle:  Momentum is a vector,
A New Class of Mobility Models for Ad Hoc Wireless Networks Rahul Amin Advisor: Dr. Carl Baum Clemson University SURE 2006.
Chapter 25 Electric Potential.
Coulomb’s Law Section
Physics Jeopardy Rules
Objectives: After completing this module, you should be able to:
Chapter 38C - Atomic Physics
Chapter 29 Electric Potential Reading: Chapter 29.
Chapter 21, Electric Charge, and electric Field
Momentum, Impulse, and Collisions
Textbook: 7.1, 7.2 Homework: pg # 2 – 6
Force and Motion (H) Newton's second law. Inertia. Weight.
Electric Force Unit 11.2.
Presentation transcript:

The Quantum Avenger An Application of Object Oriented Design Principles in Game Development Andres Calderon Jaramillo - Dr. Hong K. Sung (Faculty Advisor) This project was developed as the final assignment for an undergraduate course in Object Oriented Programming at the University of Central Oklahoma. Students were instructed to design an animated game and implement it in the Java programming language. There were two primary constraints: first, at least two design patterns were to be used; second, the game design needed to follow a generalized data-animator-renderer framework provided by the instructor. BACKGROUND 1 [1] “2-Dimensional Elastic Collisions Without Trigonometry.” Accessed: March 15, Game development is an area in which object-oriented programming principles can be applied quite naturally. Game entities can be readily represented as objects, and relationships between entities can be modeled using associations, inheritance, polymorphism, and design patterns. A game, The Quantum Avenger, was designed to meet the assignment's requirements. In essence, the game consists of a number of objects that can be shot by a ship controlled by the player through the keyboard. Some of the basic rules include: The player selects among three levels of difficulty. At the beginning of a session, there is a fixed number of spherical objects on the screen. These objects may be electrically charged and must interact with each other accordingly: positive spheres are red, negative spheres are blue, and neutral spheres are white. The player provides acceleration and direction to the ship (an equilateral triangle) using the keyboard. There are some restrictions on the ship’s velocity to prevent it from speeding out of control. The player makes the ship fire missiles using the keyboard in order to destroy spherical objects. The ship may be electrically charged (as indicated by the color of the tip). It can affect the motion of spherical objects. Spherical objects do not exert action-at-a- distance forces on the ship. Every collision of the ship with an spherical object decreases the ship’s health. The player wins when all objects have been destroyed. The player loses when the ship’s health reaches zero. METHODS 2 REFERENCES 4 Design Patterns At least two design patterns were used in this project: Strategy pattern: This pattern is used to make the different game screens (main menu, game area, losing screen, winning screen, etc.) interchangeable while allowing each one to encapsulate specific behaviors: In another scenario, this pattern is used to centrally handle some events generated within each game screen: Observer pattern: In one scenario, this pattern is used to notify the main data structure of the disappearance of an object from the screen (a spherical object being destroyed or a missile crossing the boundaries of the game area): CONCLUSION 3 A satisfactory solution to the final assignment was provided. It successfully illustrated the application of object-oriented design principles to the development of a game that used non-trivial simulations of physical phenomena. Basic Framework The framework provided by the instructor gave students a general starting point for the game design. There were three components used in this framework: Data structure (GameData in figure): an object that stores the entities in the game. Animator: an object that uses a separate thread to periodically update the state of the game entities. Renderer (GamePanel in figure): an object that displays the game entities in their current state. Collision Detection Collisions between spherical objects are detected using their radii. More formally, two spherical objects have collided if and only if the distance between their centers is less than or equal to the sum of their radii. In order to detect a collision between the ship and a spherical object, the boundary of the ship is approximated using a circle. Its center is the circumcenter of the triangle. The radius is calculated as follows: Using this circle, collisions are detected in the same manner as with spherical objects. Collisions with walls and missiles are detected in a similar fashion. Collision Handling Collisions between spherical objects must be handled using the laws of physics, including the conservation of momentum. Collisions are assumed to be elastic. The method used to calculate the speed and direction of each object after the collision is explained in detail in [1]. Actions at a Distance Because the ship and the spherical objects may be electrically charged, their interactions must be simulated. A formula analogous to Coulomb’s Law is used to calculate the force between two charged bodies: The acceleration and velocity are calculated from this force using methods from classical mechanics. Spherical Object (Negative) Spherical Object (Positive) Spherical Object (Neutral) Ship (Blue tip - negative) Missile Animator GamePanel GameData High-Level Framework’s UML Class Diagram Circumcircle Incircle Collision Approximation Circle Object for which force is being calculated JPanel IntroductionPanel GamePanel ResultScreen Main GameFigure Particle FreeParticle Missile > Disappearable > Disappearable > DisappearanceListener > DisappearanceListener GameData 1..* DisappearanceEvent JPanel GamePanel ResultScreen > Screen > Screen > ScreenListener > ScreenListener Main ScreenEvent IntroductionPanel Circumcenter