Exemple #1
0
        //public GameplayHelper helper, temp;
        public attackGame()
        {
            hel = hel as GameplayHelper;
            _To = "ovo jebeno izgleda da radi";
            graphics = new GraphicsDeviceManager(this);
            PhoneApplicationService phoneAppService = PhoneApplicationService.Current;
            phoneAppService.UserIdleDetectionMode = IdleDetectionMode.Disabled;
            graphics.IsFullScreen = true;
            //Set the Windows Phone screen resolution
            graphics.PreferredBackBufferWidth = 480;
            graphics.PreferredBackBufferHeight = 800;
            //
            Content.RootDirectory = "Content";
            backScreen = new SplashScreen();
            loadingScreen = new LoadingScreen(1,2);
            //helper = helper as GameplayHelper;
            //temp = temp as GameplayHelper;
            // Hook up lifecycle events

            PhoneApplicationService.Current.Launching += new EventHandler<LaunchingEventArgs>(Current_Launching);
            PhoneApplicationService.Current.Activated += new EventHandler<ActivatedEventArgs>(Current_Activated);
            //PhoneApplicationService.Current.Closing += new EventHandler<ClosingEventArgs>(Current_Closing);
            PhoneApplicationService.Current.Deactivated += new EventHandler<DeactivatedEventArgs>(Current_Deactivated);

            // Frame rate is 30 fps by default for Windows Phone.
            TargetElapsedTime = TimeSpan.FromSeconds(1 / 30.0);

            //Create a new instance of the Screen Manager
            screenManager = new ScreenManager(this);
            Components.Add(screenManager);
            //Debug.WriteLine("konstruktor");
        }
Exemple #2
0
        void Current_Activated(object sender, ActivatedEventArgs e)
        {
            Debug.WriteLine("activating event...");
            if (PhoneApplicationService.Current.State.ContainsKey("loading"))
            {

            }

            //if (MediaPlayer.State == MediaState.Playing) isBackgroundSong = true;

            backScreen = PhoneApplicationService.Current.State["background"] as SplashScreen;
            loadingScreen = PhoneApplicationService.Current.State["loading"] as LoadingScreen;

            if (PhoneApplicationService.Current.State.ContainsKey("Unsaved_To"))
            {
                tem = hel;
                attackGame.GameplayHelper = hel;
                //tem  = PhoneApplicationService.Current.State["Unsaved_To"] as GameplayHelper;
                PhoneApplicationService.Current.State.Remove("Unsaved_To");
                Debug.WriteLine("ima");
            }

            ReloadRequired = true;

            //PhoneApplicationService.Current.State[InGameKey] = true;

            screenManager = new ScreenManager(this);

            // Display the main screen
            screenManager.AddScreen(new SplashScreen());
            screenManager.AddScreen(new LoadingScreen());
        }