beginning game development in xna

21
{ Game Development Using Visual Studio and XNA

Upload: guest9e9355e

Post on 14-Jan-2015

314 views

Category:

Education


1 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Beginning Game Development in XNA

{

Game Development

Using Visual Studio and XNA

Page 2: Beginning Game Development in XNA

{Arvind Raja Yadav

Microsoft Student Partner

Lead Programmer – Neptune, a Half Life 2 Modification

Programmer – Dystopia, a Half Life 2 Modification available on Steam

I also make a lot of small games in various languages for fun

Page 3: Beginning Game Development in XNA

What is a game?

Page 4: Beginning Game Development in XNA

{ {World of Goo = Game MS Word = Software

How do we know the difference?

Page 5: Beginning Game Development in XNA

{

Here’s what games have that software

doesn’t :1. Conditions for victory/failure ;2. Testing various qualities of the player ;3. Withholding content from the player;4. Thinking for themselves ;5. Partially under the player’s control ;6. Changing objectives and/or methods;7. They are more fun!

Page 6: Beginning Game Development in XNA

The basic structure of a gameInitialize content

While (exit condition is false){

Get user input

Run input related logic

Run input independent logic

Draw graphics and play sounds}

Shut down

Page 7: Beginning Game Development in XNA

{

1. Windows doesn’t allow direct access to it’s display and sound drivers.

2. APIs make coding games much easier

3. APIs also mean that we need not worry about compatibility issues

Why do we need an API to make games ?

Page 8: Beginning Game Development in XNA

{I’m not going to teach you how to make Halo in 3 days.

DISCLAIMER

It took me and my team about 2 weeks to make this level work.

Page 9: Beginning Game Development in XNA

{

XNA allows you to make games for both Windows and Xbox 360 platforms using the same code and assets.

Introducing

Page 10: Beginning Game Development in XNA

{1. Open Visual C#

2008 Express Edition

2. Select “File”, then “New Project”

3. You should see a dialog like the one here

4. Select “Windows Game (3.1)” and enter a name of your choice

Getting started with XNA

Page 11: Beginning Game Development in XNA

The skeleton code

Page 12: Beginning Game Development in XNA

Constructor; Initialize; LoadContent;

UnloadContent;

Update; Draw

Contents of the game class

}}

}

Getting content from the disk into the main memory + graphics memory

Removing content from the memory

Game logic and drawing

Page 13: Beginning Game Development in XNA

Display text on the screen

Page 14: Beginning Game Development in XNA

Display an image on the screen

Page 15: Beginning Game Development in XNA

Getting input from the keyboard

Page 16: Beginning Game Development in XNA

Changing window size (resolution);

Full screen/windowed mode ;

Changing window properties

Page 17: Beginning Game Development in XNA

{Print a message when the image moves off-screen

Exercise : Make an image move using the arrow keys

Page 18: Beginning Game Development in XNA

Using the mouse

Page 19: Beginning Game Development in XNA

XNA Time Management

Page 20: Beginning Game Development in XNA

Our first game : Dodger

Page 21: Beginning Game Development in XNA

{

Congratulations!

If everything went well, you just made a game by yourself !