1 / 21

Introduction to Jam’s Video Game Package

Introduction to Jam’s Video Game Package. The Plan. Scope of Video Game Package Basic Design of the Video Game Package Steps to making a game How the Pong was made Limitations of the Video Game Package. Scope of the Video Game Package. Goals of Jam’s Video Game Package Simple to use

adelio
Download Presentation

Introduction to Jam’s Video Game Package

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Introduction to Jam’sVideo Game Package CPS4: Java for Video Games http://www.cs.duke.edu/education/courses/spring04/cps004/calendar.html

  2. The Plan • Scope of Video Game Package • Basic Design of the Video Game Package • Steps to making a game • How the Pong was made • Limitations of the Video Game Package CPS4: Java for Video Games http://www.cs.duke.edu/education/courses/spring04/cps004/calendar.html

  3. Scope of the Video Game Package • Goals of Jam’s Video Game Package • Simple to use • Reasonably fast • Designed to be examined and modified for academic purposes in computer science courses • What Jam’s package is not designed for • High speed animation/user input • Scripting games • Complex games CPS4: Java for Video Games http://www.cs.duke.edu/education/courses/spring04/cps004/calendar.html

  4. JFrame Or Applet GameLoop Animation Canvas Mouse Keyboard Sprite Sprite Sprite Tracker Tracker Tracker Basic Design of theVideo Game Package CPS4: Java for Video Games http://www.cs.duke.edu/education/courses/spring04/cps004/calendar.html

  5. Basic Design of theVideo Game Package Tracker The Tracker is what Makes the BallSprite move CPS4: Java for Video Games http://www.cs.duke.edu/education/courses/spring04/cps004/calendar.html

  6. Basic Design of theVideo Game Package • Point2D.Double getLocation() • double getScaleFactor() • double getRotationAddition() • void advanceTime() Tracker CPS4: Java for Video Games http://www.cs.duke.edu/education/courses/spring04/cps004/calendar.html

  7. Sprite Tracker Basic Design of theVideo Game Package CPS4: Java for Video Games http://www.cs.duke.edu/education/courses/spring04/cps004/calendar.html

  8. Sprite Tracker Basic Design of theVideo Game Package Has instance variables, and mutator and accessor methods for: • Shape • Location • Size • Rotation • Color CPS4: Java for Video Games http://www.cs.duke.edu/education/courses/spring04/cps004/calendar.html

  9. Animation Canvas Sprite Sprite Sprite Tracker Tracker Tracker Basic Design of theVideo Game Package CPS4: Java for Video Games http://www.cs.duke.edu/education/courses/spring04/cps004/calendar.html

  10. Animation Canvas Sprite Sprite Sprite Tracker Tracker Tracker Basic Design of theVideo Game Package AnimationCanvasis a JPanel • with a collection of Sprites • that paints itself by painting all of its Sprites CPS4: Java for Video Games http://www.cs.duke.edu/education/courses/spring04/cps004/calendar.html

  11. GameLoop Animation Canvas Mouse Keyboard Sprite Sprite Sprite Tracker Tracker Tracker Basic Design of theVideo Game Package GameLoop adds: • animation • interaction via • Keyboard • Mouse CPS4: Java for Video Games http://www.cs.duke.edu/education/courses/spring04/cps004/calendar.html

  12. Basic Design of theVideo Game Package JFrame or Applet used to: • Put the game on the screen • Start the game • Provide game control JFrame Or Applet CPS4: Java for Video Games http://www.cs.duke.edu/education/courses/spring04/cps004/calendar.html

  13. JFrame Or Applet GameLoop Animation Canvas Mouse Keyboard Sprite Sprite Sprite Tracker Tracker Tracker Basic Design of theVideo Game Package CPS4: Java for Video Games http://www.cs.duke.edu/education/courses/spring04/cps004/calendar.html

  14. Steps to Making a Game • Extend GameLoop.java • In Constructor • Make Sprites • Make Trackers • Attach Trackers to Sprites • Add Sprites to AnimationCanvas • In advanceFrame provide game logic • Make a JFrame or Applet • Add extended GameLoop to JFrame or Applet • setFrameRate to start the game CPS4: Java for Video Games http://www.cs.duke.edu/education/courses/spring04/cps004/calendar.html

  15. JFrame Or Applet GameLoop Animation Canvas Mouse Keyboard Sprite Sprite Sprite Tracker Tracker Tracker Basic Design of theVideo Game Package • Extend GameLoop.java • In Constructor • Make Sprites • Make Trackers • Attach Trackers to Sprites • Add Sprites to AnimationCanvas • In advanceFrame provide game logic • Make a JFrame or Applet • Add extended GameLoop to JFrame or Applet • setFrameRate to start the game CPS4: Java for Video Games http://www.cs.duke.edu/education/courses/spring04/cps004/calendar.html

  16. How Pong was Made • BallSprite was written to extend Sprite • WallSprite was written to extend Sprite • ProjectileTracker was written to implement a Tracker • PongLoop was written to extend GameLoop • Pong was written to use PongLoop CPS4: Java for Video Games http://www.cs.duke.edu/education/courses/spring04/cps004/calendar.html

  17. How Pong was Made Some of the more complex parts of Pong that we’ll talk about in more detail later: • Loops • Conditionals • Event handling • Inheritance & Interfaces • Collections • Collision detection CPS4: Java for Video Games http://www.cs.duke.edu/education/courses/spring04/cps004/calendar.html

  18. How Pong was Made What you will need to know shortly: • Basic classes in the package • Basic structure of the package • Basic steps to making the game • General idea about how Pong.java and PongLoop.java work • Enough familiarity to make minor modifications to BallSprite and PongLoop CPS4: Java for Video Games http://www.cs.duke.edu/education/courses/spring04/cps004/calendar.html

  19. How Pong was Made What you don’t need to understand yet: • All of the classes in the package • All of the code in the basic classes • How to make your own classes like Pong and PongLoop from scratch CPS4: Java for Video Games http://www.cs.duke.edu/education/courses/spring04/cps004/calendar.html

  20. How Pong was Made What you’ll be doing in the next homework: (in addition to problems from Big Java) • Altering BallSprite • Altering ProjectileTracker …and it will be fun (when it works) CPS4: Java for Video Games http://www.cs.duke.edu/education/courses/spring04/cps004/calendar.html

  21. How Pong was Made Let’s take a look at two classes: • Open up a web browser • Go to the course website and download pong.jar to the desktop (from code link) • Open up Eclipse • Import pong.jar • Look in tipgame for BallSprite.java • Look in tipgame for ProjectileTracker.java CPS4: Java for Video Games http://www.cs.duke.edu/education/courses/spring04/cps004/calendar.html

More Related