Windows Universal apps Getting Started

The current release was created using Visual Studio 2013 Update 2.

Sample Project

Once you have a development environment and hardware setup, you can download the source code and check out the sample project inside the solution.

Trying the Demo

Set the Windows app as your default project - right click Spritehand.PhysicsHelper.Demos.Windows and select "Set as startup project". This demo shows how to dynamically add and delete user controls, track performance, and use nested Storyboard animations inside physics objects. Here are the main highlights of the advanced demo:

Shape Types

PhysicsSprite objects contain a ShapeType property which defines the boundary shape for collisions. The default ShapeType for a PhysicsSprite is a Rectangle, but if we needed a circular or polygon shape, we can change the ShapeType property to Ellipse or Polygon.

Here is an example of defining a circular sprite using ShapeType Ellipse:
<ph:PhysicsSprite x:Name="ball" Canvas.Left="350" Width="100" Height="100" ShapeType="Ellipse" RestitutionCoefficient="0.8">
    <Ellipse Width="100" Height="100" Fill="LightYellow"/>
</ph:PhysicsSprite>


If we need a more exact (polygon) shape, we can accomplish complex shapes by defining a Path element as the first element in our PhysicsSprite, and setting the ShapeType to Polygon. Note that you could set the Visibility of this boundary sprite to Collapsed if you have a complex design inside the PhysicsSprite that you are defining the basic boundary for.
<ph:PhysicsSprite Height="78.667" x:Name="cnvBody" Width="197" Canvas.Left="10" Canvas.Top="0" ShapeType="Polygon">
    <Path x:Name="bodyBoundary"  Fill="Red" Data="M2,72 L196,76 L190,43 L136,28 L123,2 L84,2 L83,28 L2,32 z" Height="75" 
             Canvas.Left="1.5" Stretch="Fill" Stroke="#FF000000" Canvas.Top="1.5" UseLayoutRounding="False" Width="195">
    </Path>
</ph:PhysicsSprite>

Accessing Farseer Objects

Under every PhysicsSprite is a Farseer Body and Fixture elements (to learn more about Farseer and see docs please visit farseerphysics.codeplex.com).
PhysicsSprite spr = cnvGame.PhysicsObjects["ball"];
spr.BodyObject.Restitution = 0;