Intro to Game Development An introduction to Swing, Java2D, JOGL, and game design Created by: Dennis Lawter and Dustin Scott.

Slides:



Advertisements
Similar presentations
Chapter 18 Building the user interface. This chapter discusses n Javas graphical user interface. n Swing: an enhancement of a library called the Abstract.
Advertisements

Using 2D sprite with OpenGL 2003 team Koguyue. Overview Motivation and basic concepts Advantages with using OpenGL Basic requirements of implementation.
Chapter 3 Creating a Business Letter with a Letterhead and Table
Lecture 24 Applets. Introduction to Applets Applets should NOT have main method but rather init, stop, paint etc They should be run through javac compiler.
Review of Java Applets Vijayan Sugumaran Decision and Information Sciences Oakland University.
Graphics Programming. In this class, we will cover: The difference between AWT and Swing Creating a frame Frame positioning Displaying information in.
Liang, Introduction to Java Programming, Fifth Edition, (c) 2005 Pearson Education, Inc. All rights reserved Chapter 16 Applets.
Chapter Day 10. © 2007 Pearson Addison-Wesley. All rights reserved4-2 Agenda Day 10 Questions from last Class?? Problem set 2 posted  10 programs from.
ICM Week 2. Structure - statements and blocks of code Any single statement ends with semicolon ; When we want to bunch a few statements together we use.
Essentials of Interactive Computer Graphics: Concepts and Implementation K. Sung, P. Shirley, S. Baer Intro and Chapter 1 Goals Give student some idea.
Liang, Introduction to Java Programming, Fifth Edition, (c) 2005 Pearson Education, Inc. All rights reserved Chapter 14 Applets, Images,
Chapter Day 9. © 2007 Pearson Addison-Wesley. All rights reserved4-2 Agenda Day 8 Questions from last Class?? Problem set 2 posted  10 programs from.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved L05 (Chapter 16) Applets.
AGD: 5. Game Arch.1 Objective o to discuss some of the main game architecture elements, rendering, and the game loop Animation and Games Development.
Overview of Computer Graphics Chapter 1. Bird’s Eye View  Overview of Computer Graphics –Basic concept of computer graphics, system, programming platforms,
INTRODUCTION TO SCRATCH. About Me Resources Scratch Website Learn Scratch Washington-Lee Computer.
© 2011 Delmar, Cengage Learning Chapter 8 Building Complex Animations.
Chapter 9 Introduction to ActionScript 3.0. Chapter 9 Lessons 1.Understand ActionScript Work with instances of movie clip symbols 3.Use code snippets.
Things you need to know George Georgiev Telerik Corporation
Using C++ and OpenGL George Georgiev Telerik Corporation
20-753: Fundamentals of Web Programming Copyright © 1999, Carnegie Mellon. All Rights Reserved. 1 Lecture 16: Java Applets & AWT Fundamentals of Web Programming.
Collision and Animation Systems in Games Jani Kajala Lead Programmer / Chief Technology Officer, Pixelgene Ltd (0)
XP Tutorial 5 Buttons, Behaviors, and Sounds. XP New Perspectives on Macromedia Flash MX Buttons Interactive means that the user has some level.
Lecture 5: Interaction 1  Principles of Interactive Graphics  CMSCD2012  Dr David England, Room 711,  ex 2271 
1 Chapter 1 Overview of Computer Graphics  To understand the basic objectives and scope of computer graphics  To identify computer graphics applications.
Ray Bradley Karla N. Juárez David Wood Advisor: Dr. Stephen Murrell May 2 nd, 2005.
Description, Classes, Interfaces, Hierarchy, Specifics George Georgiev Telerik Software Academy academy.telerik.com Technical Trainer itgeorge.net.
3461A Readings from the Swing Tutorial. 3461A Overview  The follow is the Table of Contents from the trail “Creating a GUI with JFC/Swing” in the “The.
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Event Driven Programming, The.
Programming games Show your version of Bo the dog. Start cannonball Preview: video, audio work session (cannonball) Homework: Cannonball with ball in a.
CS 112 Department of Computer Science George Mason University CS 112 Department of Computer Science George Mason University Writing Graphic Applications.
Chapter 10: Applets and Advanced Graphics The Applet Class The Applet Class The HTML Tag The HTML Tag Passing Parameters to Applets Passing Parameters.
Ch 3-4: GUI Basics Java Software Solutions Foundations of Program Design Sixth Edition by Lewis & Loftus Coming up: GUI Components.
More on Hierarchies 1. When an object of a subclass is instantiated, is memory allocated for only the data members of the subclass or also for the members.
Field Trip #19 Animations with Java By Keith Lynn.
1 CSC111H Graphical User Interfaces (GUIs) Introduction GUIs in Java Understanding Events A Simple Application The Containment Hierarchy Layout Managers.
Graphic User Interface. Graphic User Interface (GUI) Most of us interact with computers using GUIs. GUIs are visual representations of the actions you.
Java Graphics Stuart Hansen 11/6/03. What’s Wrong with OpenGL Graphics – not GUI –No real support of text boxes, buttons, etc. Procedural - not OOP –No.
Graphics and Event-Driven Programming in Java John C. Ramirez Department of Computer Science University of Pittsburgh.
2006 Adobe Systems Incorporated. All Rights Reserved. 1 INTRODUCTION TO ADOBE FLASH CS3.
Game Maker Terminology
Applets Yong Choi School of Business CSU, Bakersfield.
Lec.10 (Chapter 8 & 9) GUI Jiang (Jen) ZHENG June 27 th, 2005.
Chapter 14 Applets and Advanced GUI  The Applet Class  The HTML Tag F Passing Parameters to Applets F Conversions Between Applications and Applets F.
Intro to Applets. Applet Applets run within the Web browser environment Applets bring dynamic interaction and live animation to an otherwise static HTML.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 6 – Graphical User Interfaces Java Foundations: Introduction to Programming.
CS324e - Elements of Graphics and Visualization Timing Framework.
Field Trip #23 Hangman By Keith Lynn. JApplet A JApplet is a top-level container An applet is a small Java program that is executed by another program.
CIS Intro to JAVA Lecture Notes Set 8 9-June-05.
Lesson 2: Reading a program. Remember: from yesterday We learned about… Precise language is needed to program Actors and Classes Methods – step by step.
Super EastGate Jon Caron, Ryan Fleming, Antonio Guarino, and Mike LoVerme Merrimack College Introduction Super EastGate is a 2D side scroller game that.
Introduction to Game Programming Pertemuan 11 Matakuliah: T0944-Game Design and Programming Tahun: 2010.
Fall UI Design and Implementation1 Lecture 13: Animation.
Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall. 1 Skills for Success with Office 2010 Vol. 1, 2e PowerPoint Lecture to Accompany.
Game Maker Tutorials Introduction Clickball IntroductionClickball Where is it? Shooting Where is it?Shooting.
Prepared by: Dr. Abdallah Mohamed, AOU-KW Unit7: Event-driven programming 1.
10/20/2005week71 Graphics, mouse and mouse motion events, KeyEvent Agenda Classes in AWT for graphics Example java programs –Graphics –Mouse events –Mouse.
Flash Session 3: Events Shiny Yang special thanks to Alex
Java Swing What is swing? Swing is a ”Lightweight” GUI ToolKit for Java Different from AWT / SWT Toolkits for GUIs Few lines of code to produce GUI elements.
MORE Genre Specific Physics
WITH PYGAME ON THE RASPBERRY PI
Lecture 09 Applets.
Background Shapes & Collision Resolution (Top-down and Side-scrolling)
Intro & Point-to-Box, Circle-to-Circle, Point-to-Circle
TECHNICAL POSTER Laser reactant objects Interactive Doors and Saving
Game Loop Update & Draw.
Week 6: Time and triggers!
Tank Game Int 10 Unit 3 – Game Maker.
TA: Nouf Al-Harbi NoufNaief.net :::
Presentation transcript:

Intro to Game Development An introduction to Swing, Java2D, JOGL, and game design Created by: Dennis Lawter and Dustin Scott

Game Theory  Logic  AI, Game Objects  Timer  The Game Loop  Controller  Java AWT listeners  Visuals & Audio  Java2D vs. OpenGL, Java Sound vs. OpenAL

Logic  GameObject – Inheritence!  Player  Affected by the controller  Enemy  Affected by AI  Ground  Serves as an obstacle or boundary  Projectile  Bullets for doing damage  NPC (Non Playable Character)  Allows greater interactivity  AI, dialogs, quests, and plot progression

Timer  The Game Loop  Slowdown  The game and graphics are affected equally by the timer.  Frame-skip  The graphics update as fast as possible, while the objects update on a timer.  Updating objects  The game loop calls each object’s update() method.  We assume this is called 60 times per second. We can start a count off this timer to pause events (slowing animation or shooting rate).  Each object can reassess its situation and act accordingly.  Simple objects may do nothing, such as a ground block.

Timer  Physics  Collision  A collision layer must be made. It can be either a bounding box, a number of smaller geographic shapes, or a pixel-by-pixel mask. A mask is a matrix of Boolean values to determine the solid pixels the object occupies.  We will define collision as two objects moving into a state wherein they share at least one pixel in their collision layer.  Intersection  If we have boxes, we can compare their x, y, width, and height to determine if they are colliding.  If we have a mask, we can shift one mask to match its position in the graphics and apply the bitwise AND function to the matrix.  Snapping  When stopping an object’s motion against a wall, we must move them into contact with the wall, rather than simply disallowing them to move.

Controller  There are a number of ways to interpret a button press  Pressed down event  Activated only at the instant the button is pressed  Held down repeating event  A Boolean holds this value so that we may check it during update.  Released event  Activated only on the release of a button. This is useful for quick press events. Compare this to the actions of clicking a link.  Typing event  Should we implement our own display for text, such as a chat window, we would have to check for focus on the chat window and add text if necessary.

Graphics  Java2D  We draw everything within a JPanel (Swing component).  We override the paint method, with a Graphics parameter.  The Graphics2D class (casted from Graphics) allows us to draw a number of shapes and objects.  We may draw lines, Strings, and Images.  JOGL  Similar to the previous methodology. A GLCanvas is made in place of a JPanel.  A GLEventListener is overridden to handle the drawing.  GLAutoDrawable is used rather than Graphics.

OpenGL vs. DirectX vs. Java2D  OpenGL – Stands for Open Graphics Library. It is an API primarily designed as an abstraction for graphical processing. It is primarily used cross-platform 3D graphics.  DirectX – Microsoft’s API for abstraction for hardware access. It includes almost all Utilities necessary for game development.  Java2D – Java’s prepackaged graphics library. Using the CPU for graphic processing, it does not standup to the other APIs due to the inability to utilize specialized hardware.

OpenGL

DirectX

Java2D  Useful for simple, quick or low graphics intensity applications.  Cross-platform  Built-in to java  Quickly overwhelmed in graphics intensive applications due to its shared CPU usage.

Setting up JOGL in Eclipse  JOGL will require system libraries to execute properly.  Eclipse must be setup to use JOGL, and must be reconfigured if the drive letter changes, unless the configurations are hard-coded.