Пример #1
0
        public static void RunGame()
        {
            game = new PhysicsGame();
            // iOS requires a user triggered action to play web audio
            if (CustomScripts.IsIOS())
            {
                game.Content.OnAllResourceLoaded = () =>
                {
                    game.IsActive = false;
                    Html5.Canvas.Remove();
                    HTMLButtonElement button = new HTMLButtonElement();
                    button.InnerHTML = "Activate web audio for iOS";
                    button.SetAttribute("style", CustomScripts.FullScreenButtonStyle);

                    button.OnClick = (e) =>
                    {
                        WebAudioHelper.Activate();
                        Document.Body.RemoveChild(button);
                        game.IsActive = true;
                        Document.Body.AppendChild(Html5.Canvas);
                    };
                    Document.Body.AppendChild(button);
                };
            }
            game.Run();
        }
Пример #2
0
 static void Main()
 {
     using (var game = new PhysicsGame())
     {
         game.Run();
     }
 }