Exemplo n.º 1
0
//inits
        private void InitGame()
        {
            this.GetNowTime();
            lastTime = nowTime;

            ImageData.SpriteReading();                                          //cropped image data

            StageManager.stageNum = 0;
            StageOrder.OrderListInit();                                 //stage order
            StageDataSetting.DataBaseReading();                         //database


            ImageData.SystemImagesReading();
            Sound.SoundEffectLoad(Canvas);

            SplashLogoOpen();


            //controlls maked
            mainCanvas = this.FindName("Canvas") as Canvas;
            lblMode    = FindName("lblGameMode") as Label;

            ctlDatabaseButton = btnViewDatabaseWindow;
            ctlMaterialButton = btnViewMaterialBrowser;
            ctlImageButton    = btnViewImageManager;

            CollisionCheck.ColliderCheckMaskGenerater(Canvas);
            MainWeapon.InitMainWeapon(Canvas);

            BalloonMessage.GenerateBalloon(Canvas);
            stpPlayerStatus            = Canvas.FindName("spPlayerStatus") as StackPanel;
            stpPlayerStatus.Visibility = Visibility.Hidden;
            Canvas.SetZIndex(spPlayerStatus, ImageZindex.status);

            var _popcantalk = new Image
            {
                Source     = ImageData.cbSystem,
                Width      = 64, Height = 32,
                Visibility = Visibility.Hidden,
            };

            ImageData.imgPopCanTalk = _popcantalk;
            Canvas.Children.Add(ImageData.imgPopCanTalk);
            Canvas.SetZIndex(ImageData.imgPopCanTalk, ImageZindex.status);


            ImageData.imgHandCursor = new Image
            {
                Source     = ImageData.cbHandCursor,
                Width      = 32, Height = 32,
                Visibility = Visibility.Hidden,
            };

            Canvas.Children.Add(ImageData.imgHandCursor);
            Canvas.SetZIndex(ImageData.imgHandCursor, ImageZindex.handCursor);

            canScreenFade.Width      = 1024;
            canScreenFade.Height     = 768;
            canScreenFade.Visibility = Visibility.Hidden;
            Canvas.Children.Add(canScreenFade);
            Canvas.SetLeft(canScreenFade, 0);
            Canvas.SetTop(canScreenFade, 0);
            Canvas.SetZIndex(canScreenFade, ImageZindex.fade);

            StageInit.InitPlayer(Canvas);
            StageInit.InitPlayerStatus(CaLife, CaMana);
        }