SlideShare a Scribd company logo
1 of 37
Developing WP7 Appswith Silverlight José Luis Latorre Microsoft MVP, UX Specialist & Brainsiders CEO http://silverlightguy.com
Generalni sponzori: Organizatori: Glavni sponzori: Generalni medijski sponzor: Sponzori: Medijski sponzori: Strateški partneri: Službena PR agencija:
Gameswith Silverlight? Why?
Silverlight is for games? Concretely, Silverlight isgood for casual gamesthatdoesn’trequireintensivegraphiccapabilities.  Wehavethefactthat: Playerslove casual games (simple & easyto pick up and putdown). Phone platforms are great for this Silverlight isgreat for this.
Why Silverlight   Compelling Cross-Platform User Experience Flexible object-oriented model Fully managed code to improve encapsulation and centralization Declarative presentation language (Xaml) Role specific tools Rapid application development  Good performance
Whatkind of games? Word games Desk games Turn based strategy games Pictorial games Platform games Touch interaction games If this is what you want to write there might be no need to learn XNA..
The Game Loop
Game Loop I ,[object Object]
 Executes once per frame
 It handles all the game logic, animation, Collisions, manages input, applies game logic, etc.
 Optimal game loop in Silverlight is usually implemented with CompositionTarget.Rendering, which executes once per rendered frame.
Final Hardware will execute 30 Frames Per Second
For details on deciding the Game Loop implementation, check http://nokola.com/ and its ”GameLoopsInSilverlight.docx” document. ,[object Object]
Game loop III protectedDateTimelastTick;     public Page() { InitializeComponent(); CompositionTarget.Rendering += new EventHandler(CompositionTarget_Rendering); lastTick = DateTime.Now; } void CompositionTarget_Rendering(object sender, EventArgs e) { DateTimenow = DateTime.Now; TimeSpanelapsed = now - lastTick; lastTick = now;     //Game Logicgoeshere }
Sprites The game characters can be represented by Sprites, which are usually represented by an image and a position on the game surface. So they have: Image. Position. Vector of movement. Other details, depending on the game.
Animated Sprites An animated sprite is the natural evolution as it can show an animation instead of a still image, which is good if the player is walking, to show a walking animation.  So they have, additionally from the Sprite: An animation or sequence of images, also called Frames. Speed of the animation ( frames per second) Number of Frames.
Game character A game character derives from a sprite or animated sprite and represents a game element, the player, an enemy, bonus, obstacle, etc.. It usually has its own logic and is tied to events that determine its behavior.
Sprite, Camera, Action (link to demo) Note: This demo isderivedfrom a samplefrom Andy Bealieu.
Collisions I If two sprites (or animated sprites) collide, for example the player and a enemy, something must happen!! For this, we must know if there is a collision between both sprites. Usually a calculation of the bounding boxes will be enough.
Collisions II First, we need the bounding boxes of the two elements we want to discover if they have collided: public static RectUserControlBounds(FrameworkElement control) { Point ptTopLeft = new Point(Convert.ToDouble(control.GetValue(Canvas.LeftProperty)), Convert.ToDouble(control.GetValue(Canvas.TopProperty))); Point ptBottomRight = new Point(Convert.ToDouble(control.GetValue(Canvas.LeftProperty)) + control.Width, Convert.ToDouble(control.GetValue(Canvas.TopProperty)) + control.Height); returnnew Rect(ptTopLeft, ptBottomRight); }
Collisions III Next we validate if both bounding boxes overlap each other: public static boolRectIntersect(Rectangle rectangle1, Rectangle rectangle2) { return (((double)rectangle1.GetValue(Canvas.LeftProperty) <= (double)rectangle2.GetValue(Canvas.LeftProperty) + rectangle2.Width)         && ((double)rectangle1.GetValue(Canvas.LeftProperty) + rectangle1.Width >= (double)rectangle2.GetValue(Canvas.LeftProperty))         && ((double)rectangle1.GetValue(Canvas.TopProperty) <= (double)rectangle2.GetValue(Canvas.TopProperty) + rectangle2.Height)         && ((double)rectangle1.GetValue(Canvas.TopProperty) + rectangle1.Height >= (double)rectangle2.GetValue(Canvas.TopProperty))); }
Input
Input via Buttons Back – Start – Search Only NOT usable for Games!
Input via Touch ,[object Object]
ManipulationStarted
ManipulationDelta
ManipulationCompleted
Supported in Emulator
Requires Multitouch Monitor,[object Object]
 Can be faked using Mouse Input + Perspective Transform-Z -X +X +Z -Y
Alltogethernow!! – A shootinggame (link to demo) Note: This demo isderivedfroma greatsamplefromMatthew Casperson.
Otherpoints
Performance Statistics ,[object Object],A – Render Thread Framerate B – UI Thread Framerate C – Amount of Video Memory Used D – Total # of Textures Used E – Total # of Intermediate Textures Used ,[object Object]
Tinted items are NOT being cached by GPU,[object Object]
StoryBoardAnimations

More Related Content

What's hot

Run and jump tutorial (part 1) actors
Run and jump tutorial (part 1)   actorsRun and jump tutorial (part 1)   actors
Run and jump tutorial (part 1) actors
Muhd Basheer
 
Final design
Final designFinal design
Final design
Bek999
 
Scratch for kids syllabus for 5 hours by bibek pandit
Scratch for kids syllabus for 5 hours by bibek panditScratch for kids syllabus for 5 hours by bibek pandit
Scratch for kids syllabus for 5 hours by bibek pandit
BibekPandit2
 
Task two workflow by tom crook
Task two workflow by tom crookTask two workflow by tom crook
Task two workflow by tom crook
TomCrook
 
Artificial intelligence In Modern-Games.
Artificial intelligence In Modern-Games. Artificial intelligence In Modern-Games.
Artificial intelligence In Modern-Games.
Nitish Kavishetti
 
Pre production
Pre productionPre production
Pre production
liamrig95
 
Chapt 5 behaviors and attributes
Chapt 5   behaviors and attributesChapt 5   behaviors and attributes
Chapt 5 behaviors and attributes
Muhd Basheer
 

What's hot (20)

Run and jump tutorial (part 1) actors
Run and jump tutorial (part 1)   actorsRun and jump tutorial (part 1)   actors
Run and jump tutorial (part 1) actors
 
Final design
Final designFinal design
Final design
 
Introduction to Game Programming: Using C# and Unity 3D - Chapter 7 (Preview)
Introduction to Game Programming: Using C# and Unity 3D - Chapter 7 (Preview)Introduction to Game Programming: Using C# and Unity 3D - Chapter 7 (Preview)
Introduction to Game Programming: Using C# and Unity 3D - Chapter 7 (Preview)
 
Scratch for kids syllabus for 5 hours by bibek pandit
Scratch for kids syllabus for 5 hours by bibek panditScratch for kids syllabus for 5 hours by bibek pandit
Scratch for kids syllabus for 5 hours by bibek pandit
 
Introduction to Game Programming: Using C# and Unity 3D - Chapter 2 (Preview)
Introduction to Game Programming: Using C# and Unity 3D - Chapter 2 (Preview)Introduction to Game Programming: Using C# and Unity 3D - Chapter 2 (Preview)
Introduction to Game Programming: Using C# and Unity 3D - Chapter 2 (Preview)
 
AI Lecture 5 (game playing)
AI Lecture 5 (game playing)AI Lecture 5 (game playing)
AI Lecture 5 (game playing)
 
GameMaker Workflow
GameMaker WorkflowGameMaker Workflow
GameMaker Workflow
 
Artificial intelligence games
Artificial intelligence gamesArtificial intelligence games
Artificial intelligence games
 
Game Playing in Artificial Intelligence
Game Playing in Artificial IntelligenceGame Playing in Artificial Intelligence
Game Playing in Artificial Intelligence
 
Task two workflow by tom crook
Task two workflow by tom crookTask two workflow by tom crook
Task two workflow by tom crook
 
Artificial intelligence In Modern-Games.
Artificial intelligence In Modern-Games. Artificial intelligence In Modern-Games.
Artificial intelligence In Modern-Games.
 
libGDX: User Input and Frame by Frame Animation
libGDX: User Input and Frame by Frame AnimationlibGDX: User Input and Frame by Frame Animation
libGDX: User Input and Frame by Frame Animation
 
Kinect Swords (2011 Version)
Kinect Swords (2011 Version)Kinect Swords (2011 Version)
Kinect Swords (2011 Version)
 
Adversarial search
Adversarial search Adversarial search
Adversarial search
 
Game playing in artificial intelligent technique
Game playing in artificial intelligent technique Game playing in artificial intelligent technique
Game playing in artificial intelligent technique
 
Introduction To 3D Gaming
Introduction To 3D GamingIntroduction To 3D Gaming
Introduction To 3D Gaming
 
Pre production
Pre productionPre production
Pre production
 
Project on ai gaming
Project on ai gamingProject on ai gaming
Project on ai gaming
 
A guide to make your own film animation short film
A guide to make your own film animation short filmA guide to make your own film animation short film
A guide to make your own film animation short film
 
Chapt 5 behaviors and attributes
Chapt 5   behaviors and attributesChapt 5   behaviors and attributes
Chapt 5 behaviors and attributes
 

Viewers also liked

Voting Lobbying And Agencies
Voting Lobbying And AgenciesVoting Lobbying And Agencies
Voting Lobbying And Agencies
mtoto
 
Edf Ht 42 01 016 A Programme Mecazir RéSultats Des Essais D
Edf Ht 42 01 016 A  Programme Mecazir RéSultats Des Essais DEdf Ht 42 01 016 A  Programme Mecazir RéSultats Des Essais D
Edf Ht 42 01 016 A Programme Mecazir RéSultats Des Essais D
guestc31bf2d
 
Velvet Revolution Party, New York 2008
Velvet Revolution Party, New York 2008Velvet Revolution Party, New York 2008
Velvet Revolution Party, New York 2008
eva.klanduchova
 
Iia 2009 International Conference Securing Global Talent Mary Anne Burke
Iia 2009 International Conference  Securing Global Talent Mary Anne BurkeIia 2009 International Conference  Securing Global Talent Mary Anne Burke
Iia 2009 International Conference Securing Global Talent Mary Anne Burke
maryanneburke
 
Emotional design
Emotional designEmotional design
Emotional design
Karla Feria
 

Viewers also liked (20)

iaa 2009 + vicente perez, mikel larios, mikel sanz
iaa 2009 + vicente perez, mikel larios, mikel sanziaa 2009 + vicente perez, mikel larios, mikel sanz
iaa 2009 + vicente perez, mikel larios, mikel sanz
 
Daily Bike Commute Sf Bay Area
Daily Bike Commute Sf Bay AreaDaily Bike Commute Sf Bay Area
Daily Bike Commute Sf Bay Area
 
Úkrania
ÚkraniaÚkrania
Úkrania
 
01. Negotiating Presentation For The Seminar Generic 2009 September Beta Rele...
01. Negotiating Presentation For The Seminar Generic 2009 September Beta Rele...01. Negotiating Presentation For The Seminar Generic 2009 September Beta Rele...
01. Negotiating Presentation For The Seminar Generic 2009 September Beta Rele...
 
Kubo kubu
Kubo kubuKubo kubu
Kubo kubu
 
Introduction To OpenMI
Introduction To OpenMIIntroduction To OpenMI
Introduction To OpenMI
 
Collierville Photography
Collierville PhotographyCollierville Photography
Collierville Photography
 
levantera
levanteralevantera
levantera
 
Voting Lobbying And Agencies
Voting Lobbying And AgenciesVoting Lobbying And Agencies
Voting Lobbying And Agencies
 
Caims 2009
Caims 2009Caims 2009
Caims 2009
 
2009.05 CRM Quidgest - Jose Torres
2009.05 CRM Quidgest - Jose Torres2009.05 CRM Quidgest - Jose Torres
2009.05 CRM Quidgest - Jose Torres
 
Edf Ht 42 01 016 A Programme Mecazir RéSultats Des Essais D
Edf Ht 42 01 016 A  Programme Mecazir RéSultats Des Essais DEdf Ht 42 01 016 A  Programme Mecazir RéSultats Des Essais D
Edf Ht 42 01 016 A Programme Mecazir RéSultats Des Essais D
 
Velvet Revolution Party, New York 2008
Velvet Revolution Party, New York 2008Velvet Revolution Party, New York 2008
Velvet Revolution Party, New York 2008
 
Imagenes
ImagenesImagenes
Imagenes
 
Central Asian countries
Central Asian countriesCentral Asian countries
Central Asian countries
 
Proceso Matriz
Proceso MatrizProceso Matriz
Proceso Matriz
 
Job quitting
Job quittingJob quitting
Job quitting
 
Iia 2009 International Conference Securing Global Talent Mary Anne Burke
Iia 2009 International Conference  Securing Global Talent Mary Anne BurkeIia 2009 International Conference  Securing Global Talent Mary Anne Burke
Iia 2009 International Conference Securing Global Talent Mary Anne Burke
 
Emotional design
Emotional designEmotional design
Emotional design
 
Преподавание информационных технологий в ВУЗе: как вырастить специалиста-прак...
Преподавание информационных технологий в ВУЗе: как вырастить специалиста-прак...Преподавание информационных технологий в ВУЗе: как вырастить специалиста-прак...
Преподавание информационных технологий в ВУЗе: как вырастить специалиста-прак...
 

Similar to Md2010 jl-wp7-sl-game-dev

Game engine terminology/glossary
Game engine terminology/glossaryGame engine terminology/glossary
Game engine terminology/glossary
gordonpj96
 
Joshua meyer y1 gd engine_terminology
Joshua meyer y1 gd engine_terminologyJoshua meyer y1 gd engine_terminology
Joshua meyer y1 gd engine_terminology
JoshCollege
 
Galactic Wars XNA Game
Galactic Wars XNA GameGalactic Wars XNA Game
Galactic Wars XNA Game
Sohil Gupta
 
daryl bates engine terminology finished
daryl bates engine terminology finisheddaryl bates engine terminology finished
daryl bates engine terminology finished
DarylBatesGames
 
Y1 gd engine_terminology
Y1 gd engine_terminologyY1 gd engine_terminology
Y1 gd engine_terminology
Shaz Riches
 
Game development with Cocos2d-x Engine
Game development with Cocos2d-x EngineGame development with Cocos2d-x Engine
Game development with Cocos2d-x Engine
Duy Tan Geek
 

Similar to Md2010 jl-wp7-sl-game-dev (20)

intern.pdf
intern.pdfintern.pdf
intern.pdf
 
Unity
UnityUnity
Unity
 
Silverlight as a Gaming Platform
Silverlight as a Gaming PlatformSilverlight as a Gaming Platform
Silverlight as a Gaming Platform
 
Game engine terminology/glossary
Game engine terminology/glossaryGame engine terminology/glossary
Game engine terminology/glossary
 
The Ring programming language version 1.7 book - Part 53 of 196
The Ring programming language version 1.7 book - Part 53 of 196The Ring programming language version 1.7 book - Part 53 of 196
The Ring programming language version 1.7 book - Part 53 of 196
 
The Ring programming language version 1.2 book - Part 36 of 84
The Ring programming language version 1.2 book - Part 36 of 84The Ring programming language version 1.2 book - Part 36 of 84
The Ring programming language version 1.2 book - Part 36 of 84
 
Joshua meyer y1 gd engine_terminology
Joshua meyer y1 gd engine_terminologyJoshua meyer y1 gd engine_terminology
Joshua meyer y1 gd engine_terminology
 
CreateJS
CreateJSCreateJS
CreateJS
 
Production RPG Maker.
Production RPG Maker. Production RPG Maker.
Production RPG Maker.
 
Sprite js vs craftyjs
Sprite js vs craftyjsSprite js vs craftyjs
Sprite js vs craftyjs
 
The Ring programming language version 1.4 book - Part 14 of 30
The Ring programming language version 1.4 book - Part 14 of 30The Ring programming language version 1.4 book - Part 14 of 30
The Ring programming language version 1.4 book - Part 14 of 30
 
Galactic Wars XNA Game
Galactic Wars XNA GameGalactic Wars XNA Game
Galactic Wars XNA Game
 
daryl bates engine terminology finished
daryl bates engine terminology finisheddaryl bates engine terminology finished
daryl bates engine terminology finished
 
Vwl art pipeline explained----2
Vwl art pipeline explained----2Vwl art pipeline explained----2
Vwl art pipeline explained----2
 
Y1 gd engine_terminology
Y1 gd engine_terminologyY1 gd engine_terminology
Y1 gd engine_terminology
 
Y1 gd engine_terminology
Y1 gd engine_terminologyY1 gd engine_terminology
Y1 gd engine_terminology
 
Game development with Cocos2d-x Engine
Game development with Cocos2d-x EngineGame development with Cocos2d-x Engine
Game development with Cocos2d-x Engine
 
Y1 gd engine_terminology
Y1 gd engine_terminologyY1 gd engine_terminology
Y1 gd engine_terminology
 
Y1 gd engine_terminology
Y1 gd engine_terminologyY1 gd engine_terminology
Y1 gd engine_terminology
 
The Ring programming language version 1.5.3 book - Part 58 of 184
The Ring programming language version 1.5.3 book - Part 58 of 184The Ring programming language version 1.5.3 book - Part 58 of 184
The Ring programming language version 1.5.3 book - Part 58 of 184
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Recently uploaded (20)

EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 

Md2010 jl-wp7-sl-game-dev

  • 1.
  • 2. Developing WP7 Appswith Silverlight José Luis Latorre Microsoft MVP, UX Specialist & Brainsiders CEO http://silverlightguy.com
  • 3.
  • 4. Generalni sponzori: Organizatori: Glavni sponzori: Generalni medijski sponzor: Sponzori: Medijski sponzori: Strateški partneri: Službena PR agencija:
  • 6. Silverlight is for games? Concretely, Silverlight isgood for casual gamesthatdoesn’trequireintensivegraphiccapabilities. Wehavethefactthat: Playerslove casual games (simple & easyto pick up and putdown). Phone platforms are great for this Silverlight isgreat for this.
  • 7. Why Silverlight Compelling Cross-Platform User Experience Flexible object-oriented model Fully managed code to improve encapsulation and centralization Declarative presentation language (Xaml) Role specific tools Rapid application development Good performance
  • 8. Whatkind of games? Word games Desk games Turn based strategy games Pictorial games Platform games Touch interaction games If this is what you want to write there might be no need to learn XNA..
  • 10.
  • 11. Executes once per frame
  • 12. It handles all the game logic, animation, Collisions, manages input, applies game logic, etc.
  • 13. Optimal game loop in Silverlight is usually implemented with CompositionTarget.Rendering, which executes once per rendered frame.
  • 14. Final Hardware will execute 30 Frames Per Second
  • 15.
  • 16. Game loop III protectedDateTimelastTick; public Page() { InitializeComponent(); CompositionTarget.Rendering += new EventHandler(CompositionTarget_Rendering); lastTick = DateTime.Now; } void CompositionTarget_Rendering(object sender, EventArgs e) { DateTimenow = DateTime.Now; TimeSpanelapsed = now - lastTick; lastTick = now; //Game Logicgoeshere }
  • 17. Sprites The game characters can be represented by Sprites, which are usually represented by an image and a position on the game surface. So they have: Image. Position. Vector of movement. Other details, depending on the game.
  • 18. Animated Sprites An animated sprite is the natural evolution as it can show an animation instead of a still image, which is good if the player is walking, to show a walking animation. So they have, additionally from the Sprite: An animation or sequence of images, also called Frames. Speed of the animation ( frames per second) Number of Frames.
  • 19. Game character A game character derives from a sprite or animated sprite and represents a game element, the player, an enemy, bonus, obstacle, etc.. It usually has its own logic and is tied to events that determine its behavior.
  • 20. Sprite, Camera, Action (link to demo) Note: This demo isderivedfrom a samplefrom Andy Bealieu.
  • 21. Collisions I If two sprites (or animated sprites) collide, for example the player and a enemy, something must happen!! For this, we must know if there is a collision between both sprites. Usually a calculation of the bounding boxes will be enough.
  • 22. Collisions II First, we need the bounding boxes of the two elements we want to discover if they have collided: public static RectUserControlBounds(FrameworkElement control) { Point ptTopLeft = new Point(Convert.ToDouble(control.GetValue(Canvas.LeftProperty)), Convert.ToDouble(control.GetValue(Canvas.TopProperty))); Point ptBottomRight = new Point(Convert.ToDouble(control.GetValue(Canvas.LeftProperty)) + control.Width, Convert.ToDouble(control.GetValue(Canvas.TopProperty)) + control.Height); returnnew Rect(ptTopLeft, ptBottomRight); }
  • 23. Collisions III Next we validate if both bounding boxes overlap each other: public static boolRectIntersect(Rectangle rectangle1, Rectangle rectangle2) { return (((double)rectangle1.GetValue(Canvas.LeftProperty) <= (double)rectangle2.GetValue(Canvas.LeftProperty) + rectangle2.Width) && ((double)rectangle1.GetValue(Canvas.LeftProperty) + rectangle1.Width >= (double)rectangle2.GetValue(Canvas.LeftProperty)) && ((double)rectangle1.GetValue(Canvas.TopProperty) <= (double)rectangle2.GetValue(Canvas.TopProperty) + rectangle2.Height) && ((double)rectangle1.GetValue(Canvas.TopProperty) + rectangle1.Height >= (double)rectangle2.GetValue(Canvas.TopProperty))); }
  • 24. Input
  • 25. Input via Buttons Back – Start – Search Only NOT usable for Games!
  • 26.
  • 31.
  • 32. Can be faked using Mouse Input + Perspective Transform-Z -X +X +Z -Y
  • 33. Alltogethernow!! – A shootinggame (link to demo) Note: This demo isderivedfroma greatsamplefromMatthew Casperson.
  • 35.
  • 36.
  • 38. Perspective 3D (PlaneProjections) – but only if they are applied by Storyboard animations.
  • 39. Uses Video Card for Transform, Rotate, Scale, Rectangular Clip
  • 40.
  • 42. Monetization Try and buy Detailed product description Screen shots Reviews & ratings Related apps Optional game content rating More apps by developer
  • 43. Monetization 70% revenue share Trial API Credit card & mobile operator billing Paid, ad funded and free apps
  • 44. Deployment Process Develop & Debug Submit& Validate Certify & Sign Windows Phone Application Deployment Service Marketplace
  • 46. Good resources http://www.andybeaulieu.com http://www.farseergames.com/blog/ http://blogs.silverarcade.com/silverlight-games-101/ http://forums.silverlight.net/ http://laumania.net/?tag=/game+development http://expression.microsoft.com/en-us/dd835381.aspx http://www.bluerosegames.com/brg/silverlight_game_development.aspx http://Silverlightguy.com
  • 47. Cool games, samples & tuts http://silverarcade.com/games/InnoveWare/quakelight http://dobbschallenge2.com/ http://silverarcade.com/games/ddtmm/vsa http://www.mashooo.com/SilverlightGames/Tire_Storm.aspx http://dl.dropbox.com/u/2681028/CodeplexData/WriteableBitmapEx/BlitSample/TestPage.html http://www.brighthub.com/internet/web-development/articles/14494.aspx
  • 48.

Editor's Notes

  1. 2.1