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..
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))); }
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