public override void ApplicationDidFinishLaunching(CCApplication application, CCWindow mainWindow)
        {
            GameAppDelegate.mainWindow = mainWindow;
            director = new CCDirector();

            application.PreferMultiSampling  = false;
            application.ContentRootDirectory = "Content";
            application.ContentSearchPaths.Add("animations");
            application.ContentSearchPaths.Add("fonts");
            application.ContentSearchPaths.Add("images");
            application.ContentSearchPaths.Add("levels");
            application.ContentSearchPaths.Add("sounds");

            CCSize windowSize = mainWindow.WindowSizeInPixels;

            // Use the SNES resolution:
            float desiredWidth  = 256.0f;
            float desiredHeight = 224.0f;

            CCScene.SetDefaultDesignResolution(desiredWidth, desiredHeight, CCSceneResolutionPolicy.ShowAll);

            mainWindow.AddSceneDirector(director);

            var scene = new LevelSelectScene(mainWindow);

            // Can skip to the GmameScene by using this line instead:
            //var scene = new GameScene(mainWindow);
            director.RunWithScene(scene);
        }
Beispiel #2
0
        public override void ApplicationDidFinishLaunching(CCApplication application, CCWindow mainWindow)
        {
            AppDelegate.mainWindow = mainWindow;
            director = new CCDirector();
            mainWindow.AddSceneDirector(director);
            application.PreferMultiSampling  = false;
            application.ContentRootDirectory = "Content";
            var windowSize = mainWindow.WindowSizeInPixels;

            var desiredWidth  = 380.0f;
            var desiredHeight = 240.0f;

            // This will set the world bounds to be (0,0, w, h)
            // CCSceneResolutionPolicy.ShowAll will ensure that the aspect ratio is preserved
            CCScene.SetDefaultDesignResolution(desiredWidth, desiredHeight, CCSceneResolutionPolicy.ShowAll);

            // Determine whether to use the high or low def versions of our images
            // Make sure the default texel to content size ratio is set correctly
            // Of course you're free to have a finer set of image resolutions e.g (ld, hd, super-hd)
            if (desiredWidth < windowSize.Width)
            {
                application.ContentSearchPaths.Add("hd");
                CCSprite.DefaultTexelToContentSizeRatio = 2.0f;
            }
            else
            {
                application.ContentSearchPaths.Add("ld");
                CCSprite.DefaultTexelToContentSizeRatio = 1.0f;
            }

            var gameScene = new GameScene(mainWindow, director);


            director.RunWithScene(gameScene);
        }
Beispiel #3
0
        public override void ApplicationDidFinishLaunching(CCApplication application)
        {
            //application.SupportedOrientations = CCDisplayOrientation.LandscapeRight | CCDisplayOrientation.LandscapeLeft;
            //application.AllowUserResizing = true;
            //application.PreferMultiSampling = false;
            application.ContentRootDirectory = "Content";


            //CCRect boundsRect = new CCRect(0.0f, 0.0f, 960, 640);

            //sharedViewport = new CCViewport(new CCRect(0.0f, 0.0f, 1.0f, 1.0f));
            //sharedWindow = application.MainWindow;
            //sharedCamera = new CCCamera(boundsRect.Size, new CCPoint3(boundsRect.Center, 100.0f), new CCPoint3(boundsRect.Center, 0.0f));

#if WINDOWS || WINDOWSGL || WINDOWSDX
            //application.PreferredBackBufferWidth = 1024;
            //application.PreferredBackBufferHeight = 768;
#elif MACOS
            //application.PreferredBackBufferWidth = 960;
            //application.PreferredBackBufferHeight = 640;
#endif

#if WINDOWS_PHONE8
            application.HandleMediaStateAutomatically = false; // Bug in MonoGame - https://github.com/Cocos2DXNA/cocos2d-xna/issues/325
#endif

            //sharedDirector = new CCDirector();
            //director.DisplayStats = true;
            //director.AnimationInterval = 1.0 / 60;


            //            if (sharedWindow.WindowSizeInPixels.Height > 320)
            //            {
            //                application.ContentSearchPaths.Insert(0,"HD");
            //            }

            sharedWindow.AddSceneDirector(sharedDirector);

            //CCScene scene = new CCScene(sharedWindow, sharedViewport, sharedDirector);
            //CCLayer layer =
            //layer.Camera = sharedCamera;

            //scene.AddChild(layer);
            sharedDirector.RunWithScene(ChipmunkDemoLayer.ActualScene);
        }
Beispiel #4
0
        public override void ApplicationDidFinishLaunching(CCApplication application, CCWindow mainWindow)
        {
            GameAppDelegate.mainWindow = mainWindow;
            director = new CCDirector();

            application.PreferMultiSampling  = false;
            application.ContentRootDirectory = "Content";
            application.ContentSearchPaths.Add("animations");
            application.ContentSearchPaths.Add("fonts");
            application.ContentSearchPaths.Add("images");
            application.ContentSearchPaths.Add("levels");
            application.ContentSearchPaths.Add("sounds");

#if __IOS__
            application.ContentSearchPaths.Add("sounds/iOS/");
#else // android
            application.ContentSearchPaths.Add("sounds/Android/");
#endif


            mainWindow.AddSceneDirector(director);


            //=============================================================
            //                   !!!TESTING AREA!!!
            //=============================================================


            /*var scene = new GameScene(mainWindow); */ /*< --------SKIPS TO GAMESCENE*/
            /*var scene = new LevelSelectScene(mainWindow);*/ /*< -------SKIPS TO LEVELSELECTSCENE*/
            var scene = new TitleScene(mainWindow); /*<-------- SLIPS TO TITLESCENE
                                                     * /*var scene = new DeathScene(mainWindow);*/ /*<-------- SLIPS TO DEATHSCENE*/
            director.RunWithScene(scene);

            //=============================================================
            //                   !!!TESTING AREA!!!
            //=============================================================
        }
Beispiel #5
0
        public override void ApplicationDidFinishLaunching(CCApplication application, CCWindow mainWindow)
        {
            GameAppDelegate.mainWindow = mainWindow;
            director = new CCDirector();

            application.PreferMultiSampling  = false;
            application.ContentRootDirectory = "Content";
            application.ContentSearchPaths.Add("animations");
            application.ContentSearchPaths.Add("fonts");
            application.ContentSearchPaths.Add("images");
            application.ContentSearchPaths.Add("levels");
            application.ContentSearchPaths.Add("sounds");

#if __IOS__
            application.ContentSearchPaths.Add("sounds/iOS/");
#else // android
            application.ContentSearchPaths.Add("sounds/Android/");
#endif

            CCSize windowSize = mainWindow.WindowSizeInPixels;

            // Use the SNES resolution:
            float desiredWidth  = 256.0f;
            float desiredHeight = 224.0f;

            CCScene.SetDefaultDesignResolution(desiredWidth, desiredHeight, CCSceneResolutionPolicy.ShowAll);

            mainWindow.AddSceneDirector(director);

            CCSimpleAudioEngine.SharedEngine.PlayBackgroundMusic("CoinTimeSong", loop: true);
            // Make the audio a little quieter:
            CCSimpleAudioEngine.SharedEngine.EffectsVolume = .3f;
            var scene = new LevelSelectScene(mainWindow);
            // Can skip to the GmameScene by using this line instead:
            //var scene = new GameScene(mainWindow);
            director.RunWithScene(scene);
        }