Game Programming with DXFramework



Similar documents
================================================================== CONTENTS ==================================================================

APPLICATION NOTE. Getting Started with pylon and OpenCV

Test Specification. Introduction

Compiler Setup and DirectX/OpenGL Setup

Tec: A Cross-Platform Game Engine

Mobile Game and App Development the Easy Way

An evaluation of JavaFX as 2D game creation tool

Python for Series 60 Platform

Index. 2D arrays, 210

Hypercosm. Studio.

Using the VMRC Plug-In: Startup, Invoking Methods, and Shutdown on page 4

RDM+ Remote Desktop for Android. Getting Started Guide

Lista alfabética de produtos disponíveis para download

Homeschool Programming, Inc.

CS 378: Computer Game Technology

01. Introduction of Android

Creating Full Screen Applications Across Multiple Displays in Extended Mode

Beginning Android 4. Games Development. Mario Zechner. Robert Green

SUDT AccessPort TM Advanced Terminal / Monitor / Debugger Version 1.37 User Manual

U.Rahamathunnisa 1, S. Pragadeeswaran 2 *Assistant Professor, SITE, VIT University, Vellore. **MS(SE) Student, SITE, VIT University, Vellore.

Rapid Game Development Using Cocos2D-JS

13 Managing Devices. Your computer is an assembly of many components from different manufacturers. LESSON OBJECTIVES

AMD CodeXL 1.7 GA Release Notes

Code::Blocks Student Manual

Kinect Interface to Play Computer Games with Movement

Mocean Android SDK Developer Guide

Video in Logger Pro. There are many ways to create and use video clips and still images in Logger Pro.

Minimum System Requirements

Applitools Eyes Web Application Guide

DEVELOPING MOBILE APPLICATIONS USING ANDROID

User s Guide. Creative Prodikeys DM

Advertising Specifications, Standards and Guidelines

OPTIMIZING YOUR PI SDK APPLICATIONS BUILDERS' CAFÉ WEBINAR SERIES

Instructor. Phone: (855) 11:00 12:00 TH. This. released. industry is the. tested and. have. textbooks and. computer Software ts.

Omnitapps Cloud Request Version 1.0 Manual

================================================================== CONTENTS ==================================================================

Table of Contents ccconvert...1 verifycc...6 ccreview...8

Creating a Simple Visual C++ Program

Designing a Graphical User Interface

BASIC PC MAINTENANCE AND BACKUP Lesson 1

Board Games They are adaptations of classic board games. Examples of board games include Chess, Checkers, Backgammon, Scrabble and Monopoly.

Camtasia Recording Settings

TouchCore, is a vision tracking engine, that allows for gesture based natural and intuitive interaction of digital content.

Working With Animation: Introduction to Flash

Research on HTML5 in Web Development

Exclaimer Mail Archiver User Manual

MXwendler Javascript Interface Description Version 2.3

SMART Board Software for Macintosh Computers FAQ

Windows PowerShell Essentials

Streaming Media System Requirements and Troubleshooting Assistance

Chapter 13: Program Development and Programming Languages

Windows Presentation Foundation (WPF)

Sharing a Screen, Documents or Whiteboard in Cisco Unified MeetingPlace

Multi-Touch Ring Encoder Software Development Kit User s Guide

The Darwin Game 2.0 Programming Guide

Arcade Game Maker Product Line Production Plan

DocuSign for Microsoft Dynamics CRM

Image Upload Known Issues...3. Implementing the Block...4. Using Adobe SWC files...4. Configuring in Flash...5

ACADEMY OF INTERACTIVE

Lord of the Rings Adventure Game

Quick Guide. pdoc Forms Designer. Copyright Topaz Systems Inc. All rights reserved.

73S1215F, 73S1217F Device Firmware Upgrade Host Driver/Application Development User s Guide April 27, 2009 Rev UG_12xxF_029

Getting Started with Vision 6

Java game programming. Game engines. Fayolle Pierre-Alain

Hand Analysis Tutorial Intel RealSense SDK 2014

IAB Full page flex Mobile Rising Star Ad Unit

PHP on IBM i: What s New with Zend Server 5 for IBM i

itunes Song Library and/or Music CD Conversion Software Installation & Operational Instructions

Unit 21 - Creating a Button in Macromedia Flash

Evaluation of Xamarin Forms for MultiPlatform Mobile Application Development

Multi-Touch Control Wheel Software Development Kit User s Guide

DAVE Usage with SVN. Presentation and Tutorial v 2.0. May, 2014

This document will describe how you can create your own, fully responsive. drag and drop template to use in the creator.

Waspmote IDE. User Guide

Slide.Show Quick Start Guide

Chapter 5 Understanding Input. Discovering Computers Your Interactive Guide to the Digital World

ANDROID DEVELOPER TOOLS TRAINING GTC Sébastien Dominé, NVIDIA

Dynamic Digital Depth (DDD) and Real-time 2D to 3D conversion on the ARM processor

RetroUI Brings back the missing features you want in Windows 8 - Try it today.

CLOUD GAMING WITH NVIDIA GRID TECHNOLOGIES Franck DIARD, Ph.D., SW Chief Software Architect GDC 2014

Deploying Microsoft Operations Manager with the BIG-IP system and icontrol

Cód. do DreamSpark.com para acesso gratuito à Microsoft Windows Store e ao Windows Phone Dev Center

Virto Pivot View for Microsoft SharePoint Release User and Installation Guide

Embedded Linux development with Buildroot training 3-day session

UniKey Family 0. UniKey Time

Yamaha 01V96 Version2 Upgrade Guide

TEGRA X1 DEVELOPER TOOLS SEBASTIEN DOMINE, SR. DIRECTOR SW ENGINEERING

Installing Hortonworks Sandbox VMware Player on Windows

CMSC 427 Computer Graphics Programming Assignment 1: Introduction to OpenGL and C++ Due Date: 11:59 PM, Sept. 15, 2015

MS 10978A Introduction to Azure for Developers

Tutorial: Packaging your server build

Jordan Shearer. Portfolio. 1Maya Modeling

Using the US-122 with GigaStudio and Cubasis

Geomagic Design. Release Notes. Get to Market Faster with Better Products at a Lower Cost V17

Transcription:

Game Programming with DXFramework Jonathan Voigt voigtjr@gmail.com University of Michigan Fall 2006

The Big Picture DirectX is a general hardware interface API Goal: Unified interface for different hardware Much better than the past Programs had to be coded for specific hardware Application DirectX Hardware 2

DXFramework is a Simple DirectX Game Engine DXFramework goals: Simplicity 2D support Object oriented design Instruction by example 3

Types of Games to Create Simple! Fun! Easy! (2D!) 4

Iterative Development Design Implementation Analysis Evaluation 5

Student Games Only the final projects are available on the web (not the arcade games) Fall 2004 (DXFramework 0.9.3): http://ai.eecs.umich.edu/soar/classes/494/showcase- 2004/Games.htm Fall 2005 (DXFramework 0.9.6): http://ai.eecs.umich.edu/soar/classes/494/showcase-2005.htm 6

Arcade Game Demo 7

DXF Capabilities Genres: arcade, action, puzzle, role playing, adventure, strategy Top down, side view, isometric Many other possibilities! 8

DXF Capabilities Sounds & Music Midi background, sound effects simple pan & volume control Input Keyboard and mouse Joystick possible: use USB joystick and be prepared to turn it in with your game! 9

DXF and DXUT Microsoft s DirectX utility library Included with DirectX SDK Included with DXFramework dxut project See DirectX samples for more on DXUT and DirectX 10

DXF Prerequisites Windows 2000/XP Microsoft Visual Studio 2005 Latest DirectX SDK Windows SDK Python interpreter Creativity 11

Installation Refer to Getting Started guide: http://dxframework.org/wiki Generally speaking: Install Visual Studio & SDKs Configure Visual Studio Download and Extract package 12

DXFramework Concepts 13

A DXF Application is a graph of Game States You create your game by defining game states (extending a GameState class) and the conditions for transitioning between them demo project Keyboard (demo) Title Joystick (demo) Mouse (demo) UI (demo) 14

Tetris as a graph of states Start Entered Name Select Type & Title Players Options Music Game High Score High Score Quit Not a high score 15

Global Data (data shared across states) What about global data? High scores Option settings Store global data in the Registrar The registrar is part of your project Registrar (public dxf::registrarinterface) RegisterStates() Global Data Utility Functions 16

Initialization main Registrar (public dxf::registrarinterface) RegisterStates() Global Data dxf::game (DXFramework) Title Options Game High Score The first state registered is used as the initial state! DXUT DirectX 17

Execution The next thing main() does is call Run() This starts the main loop: Input Update Update Render Each iteration of this loop represents a frame This loop executes as fast as possible DXF uses variable discrete Faster hardware runs faster Time elapsed is available to Update() When Run() exits, so does the program 18

Key Points in the Game Loop Load() Start Update() Render2D() Update current state pointer Poll input Present the back buffer to the screen DXFChangeState() Unload() Load() new state Update() current state Render everything to back buffer Unload() previous state Yes Did update request a state transition? No Set up video device for rendering 19

Creating States Extend dxf::gamestate2d Implement the necessary functions Need a complex GUI? Extend dxf::gamestategui instead Need sub-states? Advanced topic Extend dxf::statemanager as well 20

Registering States Registrar RegisterStates() DXFRegisterState(string, state pointer) const std::wstring Registrar::kTitle = L Title ; const std::wstring Registrar::kKeyboard = L Keyboard ; dxf::dxfregisterstate(ktitle, Title::Instance()); dxf::dxfregisterstate(kkeyboard, Keyboard::Instance()); dxf::dxfchangestate(registrar::kkeyboard); 21

DXF Engine Architecture dxf::model states dxf::game top level container dxf::view video device dxf::console debugging dxf::controller input devices 22

Other DXF Components Sprites Almost everything on the screen Many acceptable formats (like.jpg,.png) Sounds Fonts Console All usually members of game states or registrar 23

Sprites are Everywhere! Origin: (0, 0) +x Back buffer/screen: 800x600 Sprites Position: 782, 462 Width: 16 pixels +y Paddle Sprite Height: 64 pixels Zeros (text) are not sprites, they are created by special Font object 24

The Back Buffer Sprite cache or canvas Same size as screen when full-screen Size of window client area when windowed 25

Drawing to the Back Buffer (Render2D) Pong::Render2D() { center.render2d(); scoreboard.render2d(); font.render2d( ); font.render2d( ); left.render2d(); right.render2d(); ball.setanimation(1); ball.setcolor( ); ball.render2d( ); ball.setcolor( ); ball.render2d( ); ball.setcolor( ); ball.render2d( ); ball.setcolor( ); ball.render2d(); } Title::Load() { DXFSetClear(true); DXFSetClearColor(WHITE); } 26

Button Input Button is Up Button is Down BUTTON_UP BUTTON_PRESSED BUTTON_RELEASED BUTTON_DOWN DXFCheckKeyboard() DXFCheckMouse() DXFCheckJoystick() 27

Mouse Input DXFGetMousePosition() Returns X,Y position on back buffer Passing this to Sprite s CheckIntersection function is useful See Button in DXFramework-Demo Very recent bug fix, see discussion or FAQ for details, or download a new copy of the framework 28

Collision Detection Simple: Check bounding rectangles No collision Overlap in y Overlap in x Overlap in both dimensions (Collision) 29

Collision Detection Simple: Check bounding circles Distance between center points Collision if distance between center points is less than sum of radii 1 2 1 2 1 2 30

Fonts Use the font class to draw text to screen Text is expensive Keep amount of text low Consider text rendered on sprites 31

Sounds Use sound class for sounds Wave files, Midi files, MP3, others Ogg? Not sure Usage similar to sprites Create using filename Render using Play 32

The DXF Console Essential debugging tool No stdout available! A decent substitution ` key toggles Output using Console::output like you would use cout: Console::output << The number is: << x << std::endl; Output is flushed only when a newline is encountered! 33

Creating and Registering Custom Commands Registrar s other function registers custom console commands Define command in global scope with correct function signature Pass pointer and string to DXFRegisterCommand 34

Using the DXUT GUI with DXFramework states Program by example See comments in UI Demo 35

Questions? Need help? I m here to help Check the FAQ on the Wiki I ll fill in content as I get it Post in the discussion forum Send me mail to schedule an appointment voigtjr@gmail.com 3828 CSE Building 36