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); }
public override void ApplicationDidFinishLaunching(CCApplication application, CCWindow mainWindow) { GameAppDelegate.mainWindow = mainWindow; application.PreferMultiSampling = false; application.ContentRootDirectory = "Content"; application.ContentSearchPaths.Add ("Entity"); application.ContentSearchPaths.Add ("fonts"); application.ContentSearchPaths.Add ("images"); application.ContentSearchPaths.Add ("Level"); application.ContentSearchPaths.Add ("Sound"); application.ContentSearchPaths.Add ("ViewsImage"); float desiredHeight = 768.0f; float desiredWidth = 1024.0f; CCScene.SetDefaultDesignResolution (desiredWidth, desiredHeight, CCSceneResolutionPolicy.ShowAll); director = new CCDirector (); mainWindow.AddSceneDirector (director); var scene = new SplashScene (mainWindow); director.RunWithScene (scene); scene.PerformSplash (); CCSimpleAudioEngine.SharedEngine.PlayBackgroundMusic ("SplashBackMusic.wav",false); CCSimpleAudioEngine.SharedEngine.PreloadEffect ("BallCollideHigh.wav"); CCSimpleAudioEngine.SharedEngine.PreloadEffect ("BallCollideLow.wav"); CCSimpleAudioEngine.SharedEngine.PreloadEffect ("ballCollideBrick.wav"); }
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); }
public CCScene(CCWindow window, CCViewport viewport, CCDirector director = null) #endif { IgnoreAnchorPointForPosition = true; AnchorPoint = new CCPoint(0.5f, 0.5f); Viewport = viewport; Window = window; Director = (director == null) ? window.DefaultDirector : director; if (window != null && director != null) { window.AddSceneDirector(director); } #if USE_PHYSICS _physicsWorld = physics ? new CCPhysicsWorld(this) : null; #endif SceneResolutionPolicy = window.DesignResolutionPolicy; }
//游戏运行时第一个运行这个 public override void ApplicationDidFinishLaunching(CCApplication application, CCWindow mainWindow) { GameAppDelegate.mainWindow = mainWindow; //CCDirector是处理scene这一级别的 //导演 director = new CCDirector (); //手机游戏开发时,要把PreferMultiSampling设为false //因为手机处理器不够强大 //这个抗锯齿算法很费cpu application.PreferMultiSampling = false; //asset的读取地址 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); //导演引入第一个scene var scene = new LevelSelectScene (mainWindow); director.RunWithScene (scene); }
public CCScene(CCWindow window, CCViewport viewport, CCDirector director = null) #endif { IgnoreAnchorPointForPosition = true; AnchorPoint = new CCPoint(0.5f, 0.5f); Viewport = viewport; Window = window; Director = (director == null) ? window.DefaultDirector : director; if (window != null && director != null) window.AddSceneDirector(director); #if USE_PHYSICS _physicsWorld = physics ? new CCPhysicsWorld(this) : null; #endif SceneResolutionPolicy = window.DesignResolutionPolicy; }