xna l01–introduction

52
Mohammad Shaker mohammadshaker.com @ZGTRShaker 2011, 2012, 2013, 2014 XNA Game Development L01 – Introduction

Upload: mohammad-shaker

Post on 14-May-2015

570 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: XNA L01–Introduction

Mohammad Shakermohammadshaker.com

@ZGTRShaker2011, 2012, 2013, 2014

XNA Game DevelopmentL01 – Introduction

Page 2: XNA L01–Introduction

LUBZHTM

Page 3: XNA L01–Introduction

References

Page 4: XNA L01–Introduction

References of this Course

• Books

– All of previous slide

• Web sites

– Many of them!

• http://www.riemers.net/

• http://rbwhitaker.wikidot.com/xna-tutorials (very good one)

Page 5: XNA L01–Introduction

Take a Look on XNA and My Other Courses @ http://www.slideshare.net/ZGTRZGTR

and @ http://mohammadshaker.com/

Available courses to the date of this slide:

Page 6: XNA L01–Introduction

Explore My

Authoring tool for Cut the Rope!A Full implementation of a clone of Cut the Rope for Research Purposes

Page 7: XNA L01–Introduction
Page 8: XNA L01–Introduction

Procedurally Generating Endless Levels for Cut the Rope Game

Page 9: XNA L01–Introduction

Is an Ongoing Research ProjectFind out more on my recent publication in:

http://mohammadshakergtr.wordpress.com/publication/

Page 10: XNA L01–Introduction

Graphics Engine Implemented in XNA

Watch trailers:http://www.youtube.com/watch?v=FM3v0tbdKrshttp://www.youtube.com/watch?v=NRWEhsFGVgEhttp://www.youtube.com/watch?v=hRxOINEO9fc

Page 11: XNA L01–Introduction
Page 12: XNA L01–Introduction

So let’s create sth awesome!

Page 13: XNA L01–Introduction
Page 14: XNA L01–Introduction
Page 15: XNA L01–Introduction

XNA! XNA

Page 16: XNA L01–Introduction

XNA!XNA Mobile

Page 17: XNA L01–Introduction

XNA!XNA Mobile

Page 18: XNA L01–Introduction

Xbox LIVE Hub

Page 19: XNA L01–Introduction

XNA Game Studio 4.0

• Powerful platform– Managed code platform, no unsafe code

– XNA Game Studio 4.0 is C# exclusive

– Performance

– Productivity

• The XNA Framework– Game Loop

– Graphics

– Audio and Media• Mic\Bluetooth

• Music

• Photos and Video

– Input• Touch\Joystick

– Sensors• Silverlight

• Accelorometer

– Target Platforms• Windows Phone\ Xbox \ PC

• Faaaaaaaaaaast Developement

Page 20: XNA L01–Introduction

Our Course!

Page 21: XNA L01–Introduction

Our Course

• Slides

• References

• Appendix (Apps, Media, Resources, …etc)

• Quizzes

Page 22: XNA L01–Introduction

Image from ebwitiker

Page 23: XNA L01–Introduction

New XNA Project!

• Content Pipeline

Page 24: XNA L01–Introduction

New XNA Project!

• Content Manager & The Content Pipeline

Content Type File Types

3D Models .x,.fbx

Textures/Images .bmp,.dds,.dib,.hdr,.jpg,.pfm,.png,.ppm,.tga

Audio .xap (an XACT audio project),.wma,.mp3,.wav

Fonts .spritefont

Effects .fx

Page 25: XNA L01–Introduction

New XNA Project!

• Content Pipeline

Page 26: XNA L01–Introduction

New XNA Project!

• Content Pipeline

Page 27: XNA L01–Introduction

New XNA Project!

• Content Pipeline, So easy to handle!

• Loading!

• Unloading

Texture2D image = Content.Load<Texture2D>("FullLogo");

Content.Unload();

Page 28: XNA L01–Introduction

New XNA Project!Creating a new project!

Page 29: XNA L01–Introduction
Page 30: XNA L01–Introduction

Initialize

LoadContent

UnloadContent

Update

Draw

Game1

XNA Game1 Class / Execution Order

Page 31: XNA L01–Introduction

New XNA Project!

• Game1()

– Class “Game1” constructor

Initialize

LoadContent

UnloadContent

Update

Draw

Game1

Page 32: XNA L01–Introduction

New XNA Project!

• Initialize()

– Allows the game to perform any initialization it needs to before starting to run.

– This is where it can query for any required services and load any non-graphic related content.

Calling base.Initialize will enumerate through any component and initialize them as well.

Initialize

LoadContent

UnloadContent

Update

Draw

Game1

Page 33: XNA L01–Introduction

New XNA Project!

• LoadContent()

– LoadContent will be called once per game and is the place to load all of your content.

Initialize

LoadContent

UnloadContent

Update

Draw

Game1

Page 34: XNA L01–Introduction

New XNA Project!

• UnloadContent()

– UnloadContent will be called once per game and is the place to unload all content.

Initialize

LoadContent

UnloadContent

Update

Draw

Game1

Page 35: XNA L01–Introduction

New XNA Project!

• Update(GameTime gameTime)*

– Allows the game to run logic such as updating the world, checking for collisions, gathering

input, and playing audio.

• Draw(GameTime gameTime)*

• This is called when the game should draw itself.

* “gameTime” Provides a snapshot of timing values.

Initialize

LoadContent

UnloadContent

Update

Draw

Game1

Page 36: XNA L01–Introduction

How “Game-Engine” works?!

Page 37: XNA L01–Introduction

New XNA Project!How XNA functions (Game1 Functions) they called?!

Initialize

LoadContent

UnloadContent

Update

Draw

Game1

Page 38: XNA L01–Introduction

Initialize

LoadContent

UnloadContent

Update

Draw

Game1

Page 39: XNA L01–Introduction

Initialize

LoadContent

UnloadContent

Update

Draw

Game1

Page 40: XNA L01–Introduction

Initialize

LoadContent

UnloadContent

Update

Draw

Game1

Page 41: XNA L01–Introduction

Initialize

LoadContent

UnloadContent

Update

Draw

Game1

Page 42: XNA L01–Introduction

Initialize

LoadContent

UnloadContent

Update

Draw

Game1

Page 43: XNA L01–Introduction

Initialize

LoadContent

UnloadContent

Update

Draw

Game1

Page 44: XNA L01–Introduction

Initialize

LoadContent

UnloadContent

Update

Draw

Game1

Page 45: XNA L01–Introduction

Initialize

LoadContent

UnloadContent

Update

Draw

Game1

Page 46: XNA L01–Introduction

Update() vs. Draw()

Page 47: XNA L01–Introduction

Update() vs. Draw()

• Update and Draw are called at different rates depending on whether

IsFixedTimeStep is true or false.

– If IsFixedTimeStep is false, Update and Draw will be called in a continuous loop.

– If IsFixedTimeStep is true, Update will be called at the interval specified in TargetElapsedTime,

while Draw will only be called if an Update is not due.

– If Draw is not called, IsRunningSlowly will be set to true.

Find out more @ http://msdn.microsoft.com/en-us/library/microsoft.xna.framework.game.update.aspx

Page 48: XNA L01–Introduction

3D World

Page 49: XNA L01–Introduction

3D World

Page 50: XNA L01–Introduction

3D World

Page 51: XNA L01–Introduction

Take a Look on my other courses @ http://www.slideshare.net/ZGTRZGTR

Available courses to the date of this slide:

Page 52: XNA L01–Introduction

http://www.mohammadshaker.com

[email protected]

https://twitter.com/ZGTRShaker @ZGTRShaker

https://de.linkedin.com/pub/mohammad-shaker/30/122/128/

http://www.slideshare.net/ZGTRZGTR

https://www.goodreads.com/user/show/11193121-mohammad-shaker

https://plus.google.com/u/0/+MohammadShaker/

https://www.youtube.com/channel/UCvJUfadMoEaZNWdagdMyCRA

http://mohammadshakergtr.wordpress.com/