SlideShare una empresa de Scribd logo
1 de 49
Descargar para leer sin conexión
Silverlight as a Gaming Platform
Overview / Introduction to our work in
Silverlight
Developing with the Silverlight 2 Framework
  Design of the Concept / Storyboards
  Architecture
  Game Logic
    Scrolling Game Board
    Player Movement
  Collision Detection
  Media - Animation / Sounds
Tools and Techniques
Silverlight as a Gaming Platform
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
Silverlight as a Gaming Platform
Silverlight as a Gaming Platform
Silverlight as a Gaming Platform
Create level treatments and script
Sketch and storyboard main game element
  Character, Prop, Backgrounds, Levels…
Illustrate and Animate game elements
Design Game screen
  Intro, Level Chooser, Game Won, Game Lost
Silverlight as a Gaming Platform
Visual Studio 2008
Expression Design 1.0
Expression Blend 2
Adobe Illustrator
Flash MX
TileStudio
Wacom Tablets
Silverlight as a Gaming Platform
Load Sequence


                    User downloads
   Users loads                                   Begin
                    our “Intro.xap”
“Page.xaml” from                             downloading
                    • Using reflection we   our “Game.xap”
  Launcher.xap        load Assembly




     Load our
                       Display our             Display
 “Main.xaml” into
                    “loading” screen        “MiniClip” intro
   “Page.xaml”
XAP / Assembly Parts
  Launcher.xap (<140k)         Game.xap (<4mb)
    AppManifest.xml             AppManifest.xml
    Launcher.dll                Game.dll
                                  Screens….
    System.Xml.Linq.dll
                                  Tiles..
    (123k)
                                  Sounds…

  Intro.xap (<50k)
    AppManifest.xml
    Intro.dll
     AudiominiS1.mp3
     AudiominiS2.mp3
     ImagesminilogoGlow.png
void Page_Loaded(object sender, RoutedEventArgse)
{
   LayoutRoot.Children.Add(_preLoader);
   Uri addressUri = new Uri(quot;ClientBin/MiniclipIdent.xapquot;,
      UriKind.Relative);

    System.Net.WebClient wc = new System.Net.WebClient();
      wc.BaseAddress = baseUri;
      wc.OpenReadCompleted += new
      OpenReadCompletedEventHandler(IdentDownloaded);
      wc.OpenReadAsync(addressUri);
    ...
}
void IdentDownloaded(object
sender, System.Net.OpenReadCompletedEventArgse)
{. . .
   foreach (XElement setting in myAssemblies)
   {
     uncompressedFile = Application.GetResourceStream(sri,
        new Uri(setting.Attribute(quot;Sourcequot;).Value,
        UriKind.Relative));

        AssemblyPartap = new AssemblyPart();
        Assembly a = ap.Load(uncompressedFile.Stream);
    }
}
Model-View-Controller Pattern

                                  Model
                      Manages the behavior and state of
                      an application. Encompasses all of
                      the business logic. Notifies the
                      view of changes




           View                                        Controller
   Renders the models                             Responding to interactions
   Receives input from users                      within the view and translates
                                                  these inputs into actions
   and fires events to the
                                                  performed by the model
   controller.
Silverlight as a Gaming Platform
Silverlight as a Gaming Platform
Board Controller

  Instantiates our collision detection
  Attaches event handlers for keyboard and
  board events

    Board events control EVERYTHING
    They by acting upon the appropriate model.
      Player Teleported
      Paddles animated
      Item picked up
      Projectile Deflected
public void playerTeleported()
{
  Teleport source = gameModel.getPlayer().getOnTeleport();
  Teleport destination = source.getLinkedTeleport();
  if (destination.getMaintainDirection())
  {
    //reset the teleport data
    gameModel.getPlayer().setOnTeleport(null);
    //continue animating the player
    MovementDescriptor nextLocation =
            getNextDirectedLocationMultiple
              (gameModel.getPlayer().getDirection());
    gameModel.getPlayer().setNewLocation(nextLocation);
    view.animatePlayerJump(nextLocation);
  }
  else
     view.scrollPlayerReturn(); //scroll over to the exit
}
Board Composition

 A board is a multi-dimensional map of tiles
 each placed at a different “z” layer.
 Each of our tiles is a “UserControl” that
 exhibit specific collision behavior
Board Composition
  Through our use of
  layers, we can maximize our
  efficiency of collision
  detection by ignoring tiles
  that are not at the same z-
  index.
  Secondly, we can allow tiles
  to be stacked to maximize
  the reusability of tiles.
Board Composition

 To achieve tiles at multiple layers, we uses a
 single parent canvas with a series of sibling
 canvases.
 Each tile at the same “z” layer, is inserted
 into one of these canvases.

 In most situations the player is located in the
 middle layer.
Levels (Boards)

  Our boards are defined in XML, generated
  by a open source tool called “TileStudio”
  Each board consists of a series of 40x40
  tiles positioned in a grid (max 100x100
  tiles).
  Our game “screen” is scrolling and only
  displays about 10 tiles across by 14 tiles
  high
Silverlight as a Gaming Platform
private void buildBoard(object sender, GameEventArgsgea)
{
  BoardDatanextBoard =
      _gameConfig.getSpecificBoard(gea.TargetLevel);
  //pull the definition of the board out of the assembly
  Stream s = this.GetType().Assembly.
    GetManifestResourceStream(namespacePrefix +
    nextBoard.filename);

     string boardXml = new StreamReader(s).ReadToEnd();
     gameModel = new GameDefintion(boardXml);
     playerScore = new PlayerStats(nextBoard);
     view.Board = gameModel;
    collider = new Collisions(gameModel);
}
Models

 Each of our tiles has a corresponding Model
 which maintains its logical state.
   Position (x,y,z), Rotation, Orientation…
 Each model exposes methods to calculate
 the appropriate reaction to game events.
Silverlight as a Gaming Platform
Scrolling Game Board

  When the game begins, our game board
  immediately renders each tile for that level,
  setting each tiles visibility to collapsed. We
  divide our level into a series of screens;
  each screen is comprised of 10x14 tiles.

  A timer begins (Game tick) which will be
  used to control tile visibility.
Scrolling Game Board
  Based on the position of the player, we
  visualize a screen of tiles one tile larger then
  our screen dimensions.
Player Movement

 The player is always centered on the
 screen.
    To give the perception that the player is
    moving, the entire board animates in opposite
    direction to the player.

 Keyboard mappings
    Space bar – Fires a projectile
    Ctrl – Activates a tile (player picks up a prop)
    Left, Right, Up and Down – Player moves
Scrolling Game Board
  Once per game tick, we evaluate if a new screen
  of tiles need to be visualized based on the
  movement of the player.
Projectile

  When the gun is fired, the scrolling board
  follows the projectile to its destination, upon
  impact (stick or deflection), the view
  animates back to the players original
  location
Silverlight as a Gaming Platform
Collisions occur when a player is asked to
consume an adjacent tile occupied by an
existing tile at its same z-layer.

Each time the appropriate movement key is
pressed, a method in our board controller is
fired, in turn calling a method within our
collision detection class. This method
checks to see if a tile at the same z-index is
blocking the movement.
When a player attempts to move to an
adjacent tile, that tile determine the effect of
the collision.
To expedite the process of finding the next
blocking tile, a generic collection is
constructed that will hold a reference to
each tile model within its relationship to the
game board.

 Through the use of polymorphism we can
quickly allow each tile to determine its
reaction to a collision.
private List<Tile>[][] gameGrid = new
List<Tile>[gameModel.getRows()][];

  for (inti=0; i<gameGrid.Length; i++)
  {
gameGrid[i] = new
List<Tile>[gameModel.getColumns()];
    for (intj=0; j<gameGrid[i].Length; j++)
     {
gameGrid[i][j] = new List<Tile>();
     }
  }
Silverlight as a Gaming Platform
Time Based
 Silverlight uses a property-based animation
 model. A model which is time based.

 Silverlight can only modify the value of a
 property over an interval of time.

 In essence, it you set the initial state, the final
 state, and the duration of your animation then
 Silverlight will calculates the frame rate.
Frame-by-Frame - Stacked Frames

 Using this technique a series of frames are
 stacked at the same X,Y. Key frames are
 created toggling the opacity of the current
 and previous frame.
Frame-by-Frame - Canvas Clip
 Using this technique, each frame is positioned
 adjacent to each other within a single canvas. A
 canvas clip is defined the width and height of a single
 frame. Key frames are created moving the canvas
 strip from right to left
Frame-by-Frame - Canvas Clip
There are numerous situations where we
use a combination of Frame-By-Frame
animations within a time-based animation.
  Player movement
  Firing of Projectile
  Deflection of Projectile
Silverlight as a Gaming Platform
Sounds

 All of our sounds are managed in a single
 sound factory (singleton).
   Extracts sounds from game assembly using
   app.manifest and an audio xml config file
   This configfile defines our LeadIn / LeadOuts
   for sound loops
   Controls the muting of sounds
   Centralizes access to our generic sound
   dictionary
Silverlight as a Gaming Platform
© 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.
The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market
     conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation.
                                 MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Silverlight as a Gaming Platform

Más contenido relacionado

La actualidad más candente

Chapt 5 behaviors and attributes
Chapt 5   behaviors and attributesChapt 5   behaviors and attributes
Chapt 5 behaviors and attributesMuhd Basheer
 
enchant js workshop on Calpoly
enchant js workshop  on Calpolyenchant js workshop  on Calpoly
enchant js workshop on CalpolyRyo Shimizu
 
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 196Mahmoud Samir Fayed
 
Node meetup feb_20_12
Node meetup feb_20_12Node meetup feb_20_12
Node meetup feb_20_12jafar104
 
Chapt 4 scene parameters
Chapt 4   scene parametersChapt 4   scene parameters
Chapt 4 scene parametersMuhd Basheer
 
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 panditBibekPandit2
 
The Ring programming language version 1.10 book - Part 71 of 212
The Ring programming language version 1.10 book - Part 71 of 212The Ring programming language version 1.10 book - Part 71 of 212
The Ring programming language version 1.10 book - Part 71 of 212Mahmoud Samir Fayed
 
Getting Started with iPhone Game Development
Getting Started with iPhone Game DevelopmentGetting Started with iPhone Game Development
Getting Started with iPhone Game DevelopmentJohn Wilker
 
JoshuaGrey-2DGameWorkflow
JoshuaGrey-2DGameWorkflowJoshuaGrey-2DGameWorkflow
JoshuaGrey-2DGameWorkflowJoshgrey16
 
Game Project / Working with Unity
Game Project / Working with UnityGame Project / Working with Unity
Game Project / Working with UnityPetri Lankoski
 
Linux userguide
Linux userguideLinux userguide
Linux userguidelogan159
 
WP7 HUB_XNA overview
WP7 HUB_XNA overviewWP7 HUB_XNA overview
WP7 HUB_XNA overviewMICTT Palma
 
libGDX: Simple Frame Animation
libGDX: Simple Frame AnimationlibGDX: Simple Frame Animation
libGDX: Simple Frame AnimationJussi Pohjolainen
 
Ch11 Search & Sort
Ch11 Search & SortCh11 Search & Sort
Ch11 Search & Sortleminhvuong
 

La actualidad más candente (20)

Chapt 5 behaviors and attributes
Chapt 5   behaviors and attributesChapt 5   behaviors and attributes
Chapt 5 behaviors and attributes
 
enchant js workshop on Calpoly
enchant js workshop  on Calpolyenchant js workshop  on Calpoly
enchant js workshop on Calpoly
 
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
 
Node meetup feb_20_12
Node meetup feb_20_12Node meetup feb_20_12
Node meetup feb_20_12
 
Chapt 4 scene parameters
Chapt 4   scene parametersChapt 4   scene parameters
Chapt 4 scene parameters
 
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
 
The Ring programming language version 1.10 book - Part 71 of 212
The Ring programming language version 1.10 book - Part 71 of 212The Ring programming language version 1.10 book - Part 71 of 212
The Ring programming language version 1.10 book - Part 71 of 212
 
Getting Started with iPhone Game Development
Getting Started with iPhone Game DevelopmentGetting Started with iPhone Game Development
Getting Started with iPhone Game Development
 
JoshuaGrey-2DGameWorkflow
JoshuaGrey-2DGameWorkflowJoshuaGrey-2DGameWorkflow
JoshuaGrey-2DGameWorkflow
 
Game Project / Working with Unity
Game Project / Working with UnityGame Project / Working with Unity
Game Project / Working with Unity
 
Linux userguide
Linux userguideLinux userguide
Linux userguide
 
Workflow
WorkflowWorkflow
Workflow
 
IsoUnity: A retro-isometric toolkit for Unity
IsoUnity: A retro-isometric toolkit for UnityIsoUnity: A retro-isometric toolkit for Unity
IsoUnity: A retro-isometric toolkit for Unity
 
Task 2 Work Flow
Task 2 Work FlowTask 2 Work Flow
Task 2 Work Flow
 
Unity 13 space shooter game
Unity 13 space shooter gameUnity 13 space shooter game
Unity 13 space shooter game
 
WP7 HUB_XNA overview
WP7 HUB_XNA overviewWP7 HUB_XNA overview
WP7 HUB_XNA overview
 
libGDX: Simple Frame Animation
libGDX: Simple Frame AnimationlibGDX: Simple Frame Animation
libGDX: Simple Frame Animation
 
WP7 HUB_XNA
WP7 HUB_XNAWP7 HUB_XNA
WP7 HUB_XNA
 
Ch11 Search & Sort
Ch11 Search & SortCh11 Search & Sort
Ch11 Search & Sort
 
Workflow
WorkflowWorkflow
Workflow
 

Destacado

Mk300 presentation
Mk300 presentationMk300 presentation
Mk300 presentationbtemp26
 
Projectile Motion
Projectile MotionProjectile Motion
Projectile Motionawalling
 
Group 2's power point (student)
Group 2's power point (student)Group 2's power point (student)
Group 2's power point (student)Nou Phouthavong
 
4.3 real time game physics
4.3 real time game physics4.3 real time game physics
4.3 real time game physicsSayed Ahmed
 
Physics of pokemon
Physics of pokemonPhysics of pokemon
Physics of pokemonNaser125
 
2.3 010 projectile_motion
2.3 010 projectile_motion2.3 010 projectile_motion
2.3 010 projectile_motiontmsanchez59
 
Ben Atherton 2D Side Scrolling Shooter Workflow
Ben Atherton 2D Side Scrolling Shooter WorkflowBen Atherton 2D Side Scrolling Shooter Workflow
Ben Atherton 2D Side Scrolling Shooter WorkflowBen_Atherton
 
Projectiles Fired Horizontally
Projectiles Fired HorizontallyProjectiles Fired Horizontally
Projectiles Fired Horizontallybilbojaggens
 
Solving Accelerated Motion Problems
Solving Accelerated Motion ProblemsSolving Accelerated Motion Problems
Solving Accelerated Motion Problemswalt sautter
 
AP Physics - Chapter 3 Powerpoint
AP Physics - Chapter 3 PowerpointAP Physics - Chapter 3 Powerpoint
AP Physics - Chapter 3 PowerpointMrreynon
 
Projectile Motion
Projectile Motion Projectile Motion
Projectile Motion Anand Raju
 
Physics -vectors-projectile motion
Physics  -vectors-projectile motionPhysics  -vectors-projectile motion
Physics -vectors-projectile motionstephm32
 

Destacado (20)

Mk300 presentation
Mk300 presentationMk300 presentation
Mk300 presentation
 
Projectile mail
Projectile mailProjectile mail
Projectile mail
 
Projectile Motion
Projectile MotionProjectile Motion
Projectile Motion
 
Projectile motion
Projectile motionProjectile motion
Projectile motion
 
Lec04
Lec04Lec04
Lec04
 
Bbal lintro
Bbal lintroBbal lintro
Bbal lintro
 
Group 2's power point (student)
Group 2's power point (student)Group 2's power point (student)
Group 2's power point (student)
 
Projectiles
ProjectilesProjectiles
Projectiles
 
4.3 real time game physics
4.3 real time game physics4.3 real time game physics
4.3 real time game physics
 
Physics of pokemon
Physics of pokemonPhysics of pokemon
Physics of pokemon
 
2.3 010 projectile_motion
2.3 010 projectile_motion2.3 010 projectile_motion
2.3 010 projectile_motion
 
Unit 22 - Projectile Motion, Weight, And Mass
Unit 22 - Projectile Motion, Weight, And MassUnit 22 - Projectile Motion, Weight, And Mass
Unit 22 - Projectile Motion, Weight, And Mass
 
Ben Atherton 2D Side Scrolling Shooter Workflow
Ben Atherton 2D Side Scrolling Shooter WorkflowBen Atherton 2D Side Scrolling Shooter Workflow
Ben Atherton 2D Side Scrolling Shooter Workflow
 
3 - Projectiles
3 - Projectiles3 - Projectiles
3 - Projectiles
 
Projectiles Fired Horizontally
Projectiles Fired HorizontallyProjectiles Fired Horizontally
Projectiles Fired Horizontally
 
Solving Accelerated Motion Problems
Solving Accelerated Motion ProblemsSolving Accelerated Motion Problems
Solving Accelerated Motion Problems
 
Projectile motion
Projectile motionProjectile motion
Projectile motion
 
AP Physics - Chapter 3 Powerpoint
AP Physics - Chapter 3 PowerpointAP Physics - Chapter 3 Powerpoint
AP Physics - Chapter 3 Powerpoint
 
Projectile Motion
Projectile Motion Projectile Motion
Projectile Motion
 
Physics -vectors-projectile motion
Physics  -vectors-projectile motionPhysics  -vectors-projectile motion
Physics -vectors-projectile motion
 

Similar a Silverlight as a Gaming Platform

Unreal Engine Basics 02 - Unreal Editor
Unreal Engine Basics 02 - Unreal EditorUnreal Engine Basics 02 - Unreal Editor
Unreal Engine Basics 02 - Unreal EditorNick Pruehs
 
Game development with Cocos2d
Game development with Cocos2dGame development with Cocos2d
Game development with Cocos2dVinsol
 
Developing a Multiplayer RTS with the Unreal Engine 3
Developing a Multiplayer RTS with the Unreal Engine 3Developing a Multiplayer RTS with the Unreal Engine 3
Developing a Multiplayer RTS with the Unreal Engine 3Nick Pruehs
 
Useful Tools for Making Video Games - XNA (2008)
Useful Tools for Making Video Games - XNA (2008)Useful Tools for Making Video Games - XNA (2008)
Useful Tools for Making Video Games - XNA (2008)Korhan Bircan
 
Galactic Wars XNA Game
Galactic Wars XNA GameGalactic Wars XNA Game
Galactic Wars XNA GameSohil Gupta
 
Multiplayer Networking Game
Multiplayer Networking GameMultiplayer Networking Game
Multiplayer Networking GameTanmay Krishna
 
Unity3d scripting tutorial
Unity3d scripting tutorialUnity3d scripting tutorial
Unity3d scripting tutorialhungnttg
 
Getting started with Verold and Three.js
Getting started with Verold and Three.jsGetting started with Verold and Three.js
Getting started with Verold and Three.jsVerold
 
Introduction to html5 game programming with impact js
Introduction to html5 game programming with impact jsIntroduction to html5 game programming with impact js
Introduction to html5 game programming with impact jsLuca Galli
 
Gdc09 Minigames
Gdc09 MinigamesGdc09 Minigames
Gdc09 MinigamesSusan Gold
 
Enhancing UI/UX using Java animations
Enhancing UI/UX using Java animationsEnhancing UI/UX using Java animations
Enhancing UI/UX using Java animationsNaman Dwivedi
 
Monogame Introduction (ENG)
Monogame Introduction (ENG)Monogame Introduction (ENG)
Monogame Introduction (ENG)Aloïs Deniel
 
A Complete Tutorial to Develop Real-Time Fighting Game with Cocos2dx
A Complete Tutorial to Develop Real-Time Fighting Game with Cocos2dxA Complete Tutorial to Develop Real-Time Fighting Game with Cocos2dx
A Complete Tutorial to Develop Real-Time Fighting Game with Cocos2dxShepHertz
 
Enterprise Tic-Tac-Toe
Enterprise Tic-Tac-ToeEnterprise Tic-Tac-Toe
Enterprise Tic-Tac-ToeScott Wlaschin
 
Introduction to the Unreal Development Kit
Introduction to the Unreal Development KitIntroduction to the Unreal Development Kit
Introduction to the Unreal Development KitNick Pruehs
 

Similar a Silverlight as a Gaming Platform (20)

Md2010 jl-wp7-sl-game-dev
Md2010 jl-wp7-sl-game-devMd2010 jl-wp7-sl-game-dev
Md2010 jl-wp7-sl-game-dev
 
Unreal Engine Basics 02 - Unreal Editor
Unreal Engine Basics 02 - Unreal EditorUnreal Engine Basics 02 - Unreal Editor
Unreal Engine Basics 02 - Unreal Editor
 
Game development with Cocos2d
Game development with Cocos2dGame development with Cocos2d
Game development with Cocos2d
 
Developing a Multiplayer RTS with the Unreal Engine 3
Developing a Multiplayer RTS with the Unreal Engine 3Developing a Multiplayer RTS with the Unreal Engine 3
Developing a Multiplayer RTS with the Unreal Engine 3
 
CreateJS
CreateJSCreateJS
CreateJS
 
Useful Tools for Making Video Games - XNA (2008)
Useful Tools for Making Video Games - XNA (2008)Useful Tools for Making Video Games - XNA (2008)
Useful Tools for Making Video Games - XNA (2008)
 
Galactic Wars XNA Game
Galactic Wars XNA GameGalactic Wars XNA Game
Galactic Wars XNA Game
 
Scmad Chapter07
Scmad Chapter07Scmad Chapter07
Scmad Chapter07
 
Multiplayer Networking Game
Multiplayer Networking GameMultiplayer Networking Game
Multiplayer Networking Game
 
Unity3d scripting tutorial
Unity3d scripting tutorialUnity3d scripting tutorial
Unity3d scripting tutorial
 
Getting started with Verold and Three.js
Getting started with Verold and Three.jsGetting started with Verold and Three.js
Getting started with Verold and Three.js
 
Introduction to html5 game programming with impact js
Introduction to html5 game programming with impact jsIntroduction to html5 game programming with impact js
Introduction to html5 game programming with impact js
 
Ubiquitous Language
Ubiquitous LanguageUbiquitous Language
Ubiquitous Language
 
Gdc09 Minigames
Gdc09 MinigamesGdc09 Minigames
Gdc09 Minigames
 
Enhancing UI/UX using Java animations
Enhancing UI/UX using Java animationsEnhancing UI/UX using Java animations
Enhancing UI/UX using Java animations
 
Monogame Introduction (ENG)
Monogame Introduction (ENG)Monogame Introduction (ENG)
Monogame Introduction (ENG)
 
A Complete Tutorial to Develop Real-Time Fighting Game with Cocos2dx
A Complete Tutorial to Develop Real-Time Fighting Game with Cocos2dxA Complete Tutorial to Develop Real-Time Fighting Game with Cocos2dx
A Complete Tutorial to Develop Real-Time Fighting Game with Cocos2dx
 
Android 3
Android 3Android 3
Android 3
 
Enterprise Tic-Tac-Toe
Enterprise Tic-Tac-ToeEnterprise Tic-Tac-Toe
Enterprise Tic-Tac-Toe
 
Introduction to the Unreal Development Kit
Introduction to the Unreal Development KitIntroduction to the Unreal Development Kit
Introduction to the Unreal Development Kit
 

Más de goodfriday

Narine Presentations 20051021 134052
Narine Presentations 20051021 134052Narine Presentations 20051021 134052
Narine Presentations 20051021 134052goodfriday
 
09 03 22 easter
09 03 22 easter09 03 22 easter
09 03 22 eastergoodfriday
 
Holy Week Easter 2009
Holy Week Easter 2009Holy Week Easter 2009
Holy Week Easter 2009goodfriday
 
Holt Park Easter 09 Swim
Holt Park Easter 09 SwimHolt Park Easter 09 Swim
Holt Park Easter 09 Swimgoodfriday
 
Swarthmore Lentbrochure20092
Swarthmore Lentbrochure20092Swarthmore Lentbrochure20092
Swarthmore Lentbrochure20092goodfriday
 
Eastercard2009
Eastercard2009Eastercard2009
Eastercard2009goodfriday
 
Easterservices2009
Easterservices2009Easterservices2009
Easterservices2009goodfriday
 
Bulletin Current
Bulletin CurrentBulletin Current
Bulletin Currentgoodfriday
 
March 2009 Newsletter
March 2009 NewsletterMarch 2009 Newsletter
March 2009 Newslettergoodfriday
 
Lent Easter 2009
Lent Easter 2009Lent Easter 2009
Lent Easter 2009goodfriday
 
Easterpowersports09
Easterpowersports09Easterpowersports09
Easterpowersports09goodfriday
 
Easter Trading 09
Easter Trading 09Easter Trading 09
Easter Trading 09goodfriday
 
Easter Brochure 2009
Easter Brochure 2009Easter Brochure 2009
Easter Brochure 2009goodfriday
 
March April 2009 Calendar
March April 2009 CalendarMarch April 2009 Calendar
March April 2009 Calendargoodfriday
 

Más de goodfriday (20)

Narine Presentations 20051021 134052
Narine Presentations 20051021 134052Narine Presentations 20051021 134052
Narine Presentations 20051021 134052
 
Triunemar05
Triunemar05Triunemar05
Triunemar05
 
09 03 22 easter
09 03 22 easter09 03 22 easter
09 03 22 easter
 
Holy Week Easter 2009
Holy Week Easter 2009Holy Week Easter 2009
Holy Week Easter 2009
 
Holt Park Easter 09 Swim
Holt Park Easter 09 SwimHolt Park Easter 09 Swim
Holt Park Easter 09 Swim
 
Easter Letter
Easter LetterEaster Letter
Easter Letter
 
April2009
April2009April2009
April2009
 
Swarthmore Lentbrochure20092
Swarthmore Lentbrochure20092Swarthmore Lentbrochure20092
Swarthmore Lentbrochure20092
 
Eastercard2009
Eastercard2009Eastercard2009
Eastercard2009
 
Easterservices2009
Easterservices2009Easterservices2009
Easterservices2009
 
Bulletin Current
Bulletin CurrentBulletin Current
Bulletin Current
 
Easter2009
Easter2009Easter2009
Easter2009
 
Bulletin
BulletinBulletin
Bulletin
 
March 2009 Newsletter
March 2009 NewsletterMarch 2009 Newsletter
March 2009 Newsletter
 
Mar 29 2009
Mar 29 2009Mar 29 2009
Mar 29 2009
 
Lent Easter 2009
Lent Easter 2009Lent Easter 2009
Lent Easter 2009
 
Easterpowersports09
Easterpowersports09Easterpowersports09
Easterpowersports09
 
Easter Trading 09
Easter Trading 09Easter Trading 09
Easter Trading 09
 
Easter Brochure 2009
Easter Brochure 2009Easter Brochure 2009
Easter Brochure 2009
 
March April 2009 Calendar
March April 2009 CalendarMarch April 2009 Calendar
March April 2009 Calendar
 

Último

20200723_insight_release_plan_v6.pdf20200723_insight_release_plan_v6.pdf
20200723_insight_release_plan_v6.pdf20200723_insight_release_plan_v6.pdf20200723_insight_release_plan_v6.pdf20200723_insight_release_plan_v6.pdf
20200723_insight_release_plan_v6.pdf20200723_insight_release_plan_v6.pdfJamie (Taka) Wang
 
UiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPathCommunity
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UbiTrack UK
 
RAG Patterns and Vector Search in Generative AI
RAG Patterns and Vector Search in Generative AIRAG Patterns and Vector Search in Generative AI
RAG Patterns and Vector Search in Generative AIUdaiappa Ramachandran
 
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostKubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostMatt Ray
 
Cloud Revolution: Exploring the New Wave of Serverless Spatial Data
Cloud Revolution: Exploring the New Wave of Serverless Spatial DataCloud Revolution: Exploring the New Wave of Serverless Spatial Data
Cloud Revolution: Exploring the New Wave of Serverless Spatial DataSafe Software
 
Linked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesLinked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesDavid Newbury
 
Spring24-Release Overview - Wellingtion User Group-1.pdf
Spring24-Release Overview - Wellingtion User Group-1.pdfSpring24-Release Overview - Wellingtion User Group-1.pdf
Spring24-Release Overview - Wellingtion User Group-1.pdfAnna Loughnan Colquhoun
 
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...Aggregage
 
Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.YounusS2
 
Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemAsko Soukka
 
UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8DianaGray10
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1DianaGray10
 
Nanopower In Semiconductor Industry.pdf
Nanopower  In Semiconductor Industry.pdfNanopower  In Semiconductor Industry.pdf
Nanopower In Semiconductor Industry.pdfPedro Manuel
 
UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6DianaGray10
 
Empowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintEmpowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintMahmoud Rabie
 
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAAnypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAshyamraj55
 
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationUsing IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationIES VE
 
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfUiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfDianaGray10
 
OpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureOpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureEric D. Schabell
 

Último (20)

20200723_insight_release_plan_v6.pdf20200723_insight_release_plan_v6.pdf
20200723_insight_release_plan_v6.pdf20200723_insight_release_plan_v6.pdf20200723_insight_release_plan_v6.pdf20200723_insight_release_plan_v6.pdf
20200723_insight_release_plan_v6.pdf20200723_insight_release_plan_v6.pdf
 
UiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation Developers
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
 
RAG Patterns and Vector Search in Generative AI
RAG Patterns and Vector Search in Generative AIRAG Patterns and Vector Search in Generative AI
RAG Patterns and Vector Search in Generative AI
 
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostKubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
 
Cloud Revolution: Exploring the New Wave of Serverless Spatial Data
Cloud Revolution: Exploring the New Wave of Serverless Spatial DataCloud Revolution: Exploring the New Wave of Serverless Spatial Data
Cloud Revolution: Exploring the New Wave of Serverless Spatial Data
 
Linked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesLinked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond Ontologies
 
Spring24-Release Overview - Wellingtion User Group-1.pdf
Spring24-Release Overview - Wellingtion User Group-1.pdfSpring24-Release Overview - Wellingtion User Group-1.pdf
Spring24-Release Overview - Wellingtion User Group-1.pdf
 
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
 
Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.
 
Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystem
 
UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
 
Nanopower In Semiconductor Industry.pdf
Nanopower  In Semiconductor Industry.pdfNanopower  In Semiconductor Industry.pdf
Nanopower In Semiconductor Industry.pdf
 
UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6
 
Empowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintEmpowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership Blueprint
 
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAAnypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
 
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationUsing IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
 
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfUiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
 
OpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureOpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability Adventure
 

Silverlight as a Gaming Platform

  • 2. Overview / Introduction to our work in Silverlight Developing with the Silverlight 2 Framework Design of the Concept / Storyboards Architecture Game Logic Scrolling Game Board Player Movement Collision Detection Media - Animation / Sounds Tools and Techniques
  • 4. 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
  • 8. Create level treatments and script Sketch and storyboard main game element Character, Prop, Backgrounds, Levels… Illustrate and Animate game elements Design Game screen Intro, Level Chooser, Game Won, Game Lost
  • 10. Visual Studio 2008 Expression Design 1.0 Expression Blend 2 Adobe Illustrator Flash MX TileStudio Wacom Tablets
  • 12. Load Sequence User downloads Users loads Begin our “Intro.xap” “Page.xaml” from downloading • Using reflection we our “Game.xap” Launcher.xap load Assembly Load our Display our Display “Main.xaml” into “loading” screen “MiniClip” intro “Page.xaml”
  • 13. XAP / Assembly Parts Launcher.xap (<140k) Game.xap (<4mb) AppManifest.xml AppManifest.xml Launcher.dll Game.dll Screens…. System.Xml.Linq.dll Tiles.. (123k) Sounds… Intro.xap (<50k) AppManifest.xml Intro.dll AudiominiS1.mp3 AudiominiS2.mp3 ImagesminilogoGlow.png
  • 14. void Page_Loaded(object sender, RoutedEventArgse) { LayoutRoot.Children.Add(_preLoader); Uri addressUri = new Uri(quot;ClientBin/MiniclipIdent.xapquot;, UriKind.Relative); System.Net.WebClient wc = new System.Net.WebClient(); wc.BaseAddress = baseUri; wc.OpenReadCompleted += new OpenReadCompletedEventHandler(IdentDownloaded); wc.OpenReadAsync(addressUri); ... }
  • 15. void IdentDownloaded(object sender, System.Net.OpenReadCompletedEventArgse) {. . . foreach (XElement setting in myAssemblies) { uncompressedFile = Application.GetResourceStream(sri, new Uri(setting.Attribute(quot;Sourcequot;).Value, UriKind.Relative)); AssemblyPartap = new AssemblyPart(); Assembly a = ap.Load(uncompressedFile.Stream); } }
  • 16. Model-View-Controller Pattern Model Manages the behavior and state of an application. Encompasses all of the business logic. Notifies the view of changes View Controller Renders the models Responding to interactions Receives input from users within the view and translates these inputs into actions and fires events to the performed by the model controller.
  • 19. Board Controller Instantiates our collision detection Attaches event handlers for keyboard and board events Board events control EVERYTHING They by acting upon the appropriate model. Player Teleported Paddles animated Item picked up Projectile Deflected
  • 20. public void playerTeleported() { Teleport source = gameModel.getPlayer().getOnTeleport(); Teleport destination = source.getLinkedTeleport(); if (destination.getMaintainDirection()) { //reset the teleport data gameModel.getPlayer().setOnTeleport(null); //continue animating the player MovementDescriptor nextLocation = getNextDirectedLocationMultiple (gameModel.getPlayer().getDirection()); gameModel.getPlayer().setNewLocation(nextLocation); view.animatePlayerJump(nextLocation); } else view.scrollPlayerReturn(); //scroll over to the exit }
  • 21. Board Composition A board is a multi-dimensional map of tiles each placed at a different “z” layer. Each of our tiles is a “UserControl” that exhibit specific collision behavior
  • 22. Board Composition Through our use of layers, we can maximize our efficiency of collision detection by ignoring tiles that are not at the same z- index. Secondly, we can allow tiles to be stacked to maximize the reusability of tiles.
  • 23. Board Composition To achieve tiles at multiple layers, we uses a single parent canvas with a series of sibling canvases. Each tile at the same “z” layer, is inserted into one of these canvases. In most situations the player is located in the middle layer.
  • 24. Levels (Boards) Our boards are defined in XML, generated by a open source tool called “TileStudio” Each board consists of a series of 40x40 tiles positioned in a grid (max 100x100 tiles). Our game “screen” is scrolling and only displays about 10 tiles across by 14 tiles high
  • 26. private void buildBoard(object sender, GameEventArgsgea) { BoardDatanextBoard = _gameConfig.getSpecificBoard(gea.TargetLevel); //pull the definition of the board out of the assembly Stream s = this.GetType().Assembly. GetManifestResourceStream(namespacePrefix + nextBoard.filename); string boardXml = new StreamReader(s).ReadToEnd(); gameModel = new GameDefintion(boardXml); playerScore = new PlayerStats(nextBoard); view.Board = gameModel; collider = new Collisions(gameModel); }
  • 27. Models Each of our tiles has a corresponding Model which maintains its logical state. Position (x,y,z), Rotation, Orientation… Each model exposes methods to calculate the appropriate reaction to game events.
  • 29. Scrolling Game Board When the game begins, our game board immediately renders each tile for that level, setting each tiles visibility to collapsed. We divide our level into a series of screens; each screen is comprised of 10x14 tiles. A timer begins (Game tick) which will be used to control tile visibility.
  • 30. Scrolling Game Board Based on the position of the player, we visualize a screen of tiles one tile larger then our screen dimensions.
  • 31. Player Movement The player is always centered on the screen. To give the perception that the player is moving, the entire board animates in opposite direction to the player. Keyboard mappings Space bar – Fires a projectile Ctrl – Activates a tile (player picks up a prop) Left, Right, Up and Down – Player moves
  • 32. Scrolling Game Board Once per game tick, we evaluate if a new screen of tiles need to be visualized based on the movement of the player.
  • 33. Projectile When the gun is fired, the scrolling board follows the projectile to its destination, upon impact (stick or deflection), the view animates back to the players original location
  • 35. Collisions occur when a player is asked to consume an adjacent tile occupied by an existing tile at its same z-layer. Each time the appropriate movement key is pressed, a method in our board controller is fired, in turn calling a method within our collision detection class. This method checks to see if a tile at the same z-index is blocking the movement.
  • 36. When a player attempts to move to an adjacent tile, that tile determine the effect of the collision.
  • 37. To expedite the process of finding the next blocking tile, a generic collection is constructed that will hold a reference to each tile model within its relationship to the game board. Through the use of polymorphism we can quickly allow each tile to determine its reaction to a collision.
  • 38. private List<Tile>[][] gameGrid = new List<Tile>[gameModel.getRows()][]; for (inti=0; i<gameGrid.Length; i++) { gameGrid[i] = new List<Tile>[gameModel.getColumns()]; for (intj=0; j<gameGrid[i].Length; j++) { gameGrid[i][j] = new List<Tile>(); } }
  • 40. Time Based Silverlight uses a property-based animation model. A model which is time based. Silverlight can only modify the value of a property over an interval of time. In essence, it you set the initial state, the final state, and the duration of your animation then Silverlight will calculates the frame rate.
  • 41. Frame-by-Frame - Stacked Frames Using this technique a series of frames are stacked at the same X,Y. Key frames are created toggling the opacity of the current and previous frame.
  • 42. Frame-by-Frame - Canvas Clip Using this technique, each frame is positioned adjacent to each other within a single canvas. A canvas clip is defined the width and height of a single frame. Key frames are created moving the canvas strip from right to left
  • 44. There are numerous situations where we use a combination of Frame-By-Frame animations within a time-based animation. Player movement Firing of Projectile Deflection of Projectile
  • 46. Sounds All of our sounds are managed in a single sound factory (singleton). Extracts sounds from game assembly using app.manifest and an audio xml config file This configfile defines our LeadIn / LeadOuts for sound loops Controls the muting of sounds Centralizes access to our generic sound dictionary
  • 48. © 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.