i makeI'm making a project to Windows Phone using Silverlight + XNA, but i dontI don't know how I can use the DrawableGameComponent because the constructor requirerequires a game ClassGame class, look how areit looks like this:
Planet.cs
class Planet : DrawableGameComponent
{
...
public Planet(Game game)
: base(game){
{
}
but in my first page of silverlight+xnaSilverlight and XNA project not is a GameGame class isit's this:
GamePage.xaml.cs
public partial class GamePage : PhoneApplicationPage
{
ContentManager contentManager;
GameTimer timer;
SpriteBatch spriteBatch;
GraphicsDevice graphic;
TouchCollection touch;
List<Planet> list;
GameComponentCollection components;
DrawableGameComponent player;
int device_width = SharedGraphicsDeviceManager.Current.GraphicsDevice.Viewport.Width;
int device_height = SharedGraphicsDeviceManager.Current.GraphicsDevice.Viewport.Height;
public GamePage()
{
InitializeComponent();
// Get the content manager from the application
contentManager = (Application.Current as App).Content;
components = new GameComponentCollection();
Planet planet = new Planet(new Game());
components.Add()
// Create a timer for this page
timer = new GameTimer();
timer.UpdateInterval = TimeSpan.FromTicks(333333);
timer.Update += OnUpdate;
timer.Draw += OnDraw;
}
Where do I need getfind the GameGame class how i make thisto pass into the DrawableGameComponent constructor? thanks much much.