Download presentation
Presentation is loading. Please wait.
Published byVernon Walsh Modified over 9 years ago
1
Super Pong Andrew S. Dunsmore CSC436 August 2004
2
Presentation Overview Rules of the Game The Design Modules of the program Technologies Used Program Demonstration Lessons Learned, Final Thoughts, Future Considerations, & Questions
3
What is Super Pong? Based on the (ancient) game, Pong Video ping pong Players move paddle to intercept ping (ball) If the ping is missed, opponent scores a point Includes numerous user- specified options Player 1: 0Player 2: 2
4
What Options Are Available? Colors can be changed Sounds can be turned on, off, or changed Multiple boards are possible Number of Players One Player against the computer Two Player Hot Seat on the same computer Two computers connected over the Internet
5
How Should We Implement This? Modular Design Components broken into modules based on the functionality that they provide Key Modules Game Loop/Control Module Physics Module AI Module Input & Menu Modules Video/Graphics Module Audio/Sound Module
6
Why use a Modular Design? Negatives are minimized – modules have high cohesion & low coupling Advantages Big problems are divided into several smaller problems Implementation can be in stages Troubleshooting and debugging is limited to individual modules Future changes or additions are easy Modules can be reused in the future Incremental nature responsible for 95% of progress
7
The Game Loop/Control Module Broken into six areas Controls the program’s flow & calls the other modules Once a called module completes, focus returns to this module
8
Physics Module Maintains positions and velocities of objects in the game world Determines results of positions & velocities of objects based on Physics Model selected by the user Currently not implemented as a separate module from the control module
9
AI Module Used only for one-player games Calculates ping’s future location based on information from Physics Module Paddle 2 then moved to the calculated location Reductions in accuracy Calculations only made every x frames Calculated location multiplied by +/- y Computer’s paddle can only move at a fixed speed
10
Input & Menu Modules Two separate modules –the same purpose (collect user inputs) but different behaviors Menu Module – sub- module of input module Uses input module to move through the menu and to make menu selections Menu selections are used to change the game environment (color, sound, board, etc.) Input Module receives keyboard inputs from the user Inputs can activate the menu, move the paddles, etc. Inputs are received in real-time and acted upon to change the game environment
11
DirectX – Why & How SDK designed by Microsoft to make video game design in Windows easier Before DirectX, designers wrote drivers for every video/sound/network/etc. card Now, all DirectX supported cards can be accessed in the same way
12
DirectX – What it is The Operating System is the software that is most intimate with the hardware DirectX is more intimate with the hardware Windows doesn’t care about many advanced features of modern hardware DirectX polls hardware for its full capabilities
13
Video/Graphics Module Implemented with the DirectDraw API Utilizes a back buffer to avoid a flashing screen Responsible for drawing all text and game objects to the screen Game objects are drawn by dynamically creating single-colored bitmaps and blitting them to the back buffer GDI text is drawn by DirectDraw through a DirectX compatible Device Context (slow to draw but fast to code)
14
Audio/Sound Module Implemented by DirectSound and DirectMusic Responsibilities Initializing the sound card and determining its capabilities Loading music (midi) and sound effects (wave) Playing the sounds Music and sounds are loaded from embedded resources If something goes wrong, program continues, but sound is marked as unplayable
15
Network Module Not yet implemented Utilized DirectPlay Responsibilities Set up an asynchronous peer-to-peer connection Communicate ping and paddle positions Ensure frame synchronization and “wing it” if necessary MAYBE – Provide an IM-like environment for user-to- user communication
16
Time for the Demonstration Did you bring earplugs?
17
Lessons Learned Good references are worth their weight in gold Start with small goals, then build on them It’s easier to work with well-documented code Having a plan before starting to code helps (sometimes)
18
The Future of Super Pong Add Multi-Player Add a Game Server Improve graphics Improve the menu’s graphics Fix the (small) hole in the special board detection algorithm Design an app to make custom boards
19
Questions? www.geocities.com/godlike499/index.html
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.