public void Initialize()
        {
            getInstance = this;

            images = new BitmapImage[24];
            imageSize = new int[24];
            try {
                images[0] = new BitmapImage(new Uri("/ArrowSimulater;component/Resource/TargetSample.png", System.UriKind.Relative));
                imageSize[0] = 64;
                for (int i = 0; i < 4; i++) {
                    images[i + 1] = new BitmapImage(new Uri("/ArrowSimulater;component/Resource/fire" + i.ToString() + ".png", System.UriKind.Relative));
                    imageSize[i + 1] = 64;
                }//5
                for (int i = 0; i < 7; i++) {
                    images[i + 5] = new BitmapImage(new Uri("/ArrowSimulater;component/Resource/Target/Sample/TargetSample" + i.ToString() + ".png", System.UriKind.Relative));
                    imageSize[i + 5] = 128;
                }//12
                images[12] = new BitmapImage(new Uri("/ArrowSimulater;component/Resource/Score/Kakejiku.png", System.UriKind.Relative));
                imageSize[12] = 100;
                for (int i = 0; i < 10; i++) {
                    images[i + 13] = new BitmapImage(new Uri("/ArrowSimulater;component/Resource/Score/ArrowSimulaterScore" + i.ToString() + ".png", System.UriKind.Relative));
                    imageSize[i + 13] = 64;
                }//23
                images[23] = new BitmapImage(new Uri("/ArrowSimulater;component/Resource/Score/Kakejiku2.png", System.UriKind.Relative));
                imageSize[23] = 100;
            }
            catch {
                Console.WriteLine("false");
            }

            sprite = new Sprite[SpriteMax];
            for (int i = 0; i < SpriteMax; i++) sprite[i] = new Sprite();

            index = 0;
        }
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            getInstance = this;

            rand = new Random();

            mainCanvas = MainCanvas;

            background = new Image();
            background.Source = null;
            background.Width = 960;
            background.Height = 540;
            background.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
            background.VerticalAlignment = System.Windows.VerticalAlignment.Top;
            background.Margin = new Thickness(0, 0, 0, 0);
            mainCanvas.Children.Add(background);

            stateSetInit();

            titleTex = new BitmapImage(new Uri("/ArrowSimulater;component/Resource/Back/ArrowSimulaterTitle.png", System.UriKind.Relative));

            tutorialTex = new BitmapImage[4];
            for (int i = 0; i < 4; i++) {
                tutorialTex[i] = new BitmapImage(new Uri("/ArrowSimulater;component/Resource/Back/ArrowSimulaterTutorial0" + i.ToString() + ".png", System.UriKind.Relative));
            }
            BackgroundTex =  new BitmapImage(new Uri("/ArrowSimulater;component/Resource/Back/ArrowSimulaterBackground01.png", System.UriKind.Relative));
            ResultBackTex = new BitmapImage(new Uri("/ArrowSimulater;component/Resource/Back/ArrowSimulaterBackground00.png", System.UriKind.Relative));
            resultTex = new BitmapImage(new Uri("/ArrowSimulater;component/Resource/Score/ArrowSimulaterResult.png", System.UriKind.Relative));
            rankingTex = new BitmapImage(new Uri("/ArrowSimulater;component/Resource/Score/ArrowSimulaterRanking.png", System.UriKind.Relative));
            SoremadeTex = new BitmapImage(new Uri("/ArrowSimulater;component/Resource/Back/soremade.png", System.UriKind.Relative));

            KinectManager kinectManager = new KinectManager();
            kinectManager.Initialize();

            Bow bow = new Bow();
            bow.Initialize();

            SpriteManager spriteManager = new SpriteManager();
            spriteManager.Initialize();

            ShootLine shootLine = new ShootLine();
            shootLine.Initialize();

            dispatcherTimer = new DispatcherTimer();

            dispatcherTimer.Interval = new TimeSpan(166666L);

            dispatcherTimer.Tick += new EventHandler(dispatcherTimer_Tick);

            dispatcherTimer.Start();

            shoot = new Shoot();

            ScoreManager scoreManager = new ScoreManager();
            scoreManager.Initialize();

            //int[] sL = { 100, 300, 500, 1000, 2000, 4000, 8000 };
            //ScoreManager.getInstance.scoreRoot.Add(sL);

            TMax = 40;
            target = new TargetBase[TMax];

            for (int i = 0; i < TMax - 15; i++) {
                target[i] = new TargetSimple();
                //target[i].setPosition((float)rand.NextDouble() * 250 + 50, (float)rand.NextDouble() * 400 + 100);
            }
            for (int i = TMax - 15; i < TMax - 3; i++) {
                target[i] = new TargetSmall();
            }
            for (int i = TMax - 3; i < TMax; i++) {
                target[i] = new TargetFire();
            }
            target[0].setPosition(100, 400);

            targetIndex = 0;

            //imageSet.Source = SpriteManager.images[0];
        }