コード例 #1
0
        public void SingleGameForm_Load(object sender, EventArgs e)
        {
            PrivateFontCollection Fonts = new PrivateFontCollection();

            Fonts.AddFontFile("./Resources/KAMIKZOM.ttf");

            Font f = new Font(Fonts.Families[0], 24f);

            scoreLabel.Font = f;
            background      = new GameImage(Properties.Resources.single_background, 400, 700);
            backGround      = background.ResizeBitmap;

            pan = new GameImage(Properties.Resources.kurbi_pan, panWid, pandHei);

            this.ClientSize = new Size(1200, 700);
            StartGame();
            scoreLabel.Text = "Score :" + score;
            kirbyRun        = new AnimationImage(Properties.Resources.kurbi_run, 8, 20.0f, 600, 150);
            kirbyStar       = new AnimationImage(Properties.Resources.kurbi_star, 8, 8.0f, 600, 150);

            if (levelTag == 1)
            {
                kirbyRun.setPosition(600, 470);
                kirbyStar.setPosition(600, 470);
            }
            else if (levelTag == 2)
            {
                kirbyRun.setPosition(950, 470);
                kirbyStar.setPosition(950, 470);
            }

            scoreLabel.Left = 900;
            previousTime    = DateTime.Now;
        }
コード例 #2
0
        private void MultiGameForm_Load(object sender, EventArgs e)
        {
            PrivateFontCollection Fonts = new PrivateFontCollection();

            Fonts.AddFontFile("./Resources/KAMIKZOM.ttf");

            Font f = new Font(Fonts.Families[0], 24f);


            this.ClientSize = new Size(1200, 700);
            background      = new GameImage(Properties.Resources.mback, 400, 700);
            backGround      = background.ResizeBitmap;

            pan = new GameImage(Properties.Resources.kurbi_pan, panWid, pandHei);

            kirby1 = new AnimationImage(Properties.Resources.kirby_run1, 8, 20.0f, 600, 150);
            kirby2 = new AnimationImage(Properties.Resources.kirby_run2, 8, 20.0f, 600, 150);

            kirbyS1 = new AnimationImage(Properties.Resources.kirby1, 8, 8.0f, 600, 150);
            kirbyS2 = new AnimationImage(Properties.Resources.kirby2, 8, 8.0f, 600, 150);

            if (levelTag == 1)
            {
                kirby1.setPosition(600, 420);
                kirbyS1.setPosition(600, 420);
                kirby2.setPosition(600, 530);
                kirbyS2.setPosition(600, 530);
            }
            else if (levelTag == 2)
            {
                kirby1.setPosition(950, 420);
                kirbyS1.setPosition(950, 420);
                kirby2.setPosition(950, 530);
                kirbyS2.setPosition(950, 530);
            }

            StartGame();
            playerScore1.Left = 900;
            playerScore1.Top  = 20;
            playerScore2.Left = 900;
            playerScore2.Top  = playerScore1.Bottom + 100;

            playerScore1.Font = f;
            playerScore2.Font = f;
            playerScore1.Text = "1P Score : " + player1Score;
            playerScore2.Text = "2P Score : " + player2Score;
            previousTime      = DateTime.Now;
        }
コード例 #3
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            playB      = new GameImage(Properties.Resources.start, 200, 50);
            highscoreB = new GameImage(Properties.Resources.high, 200, 50);
            quitB      = new GameImage(Properties.Resources.quit, 200, 50);
            titleL     = new GameImage(Properties.Resources.title, 400, 200);

            playButton.BackgroundImage      = playB.ResizeBitmap;
            highscoreButton.BackgroundImage = highscoreB.ResizeBitmap;
            quitButton.BackgroundImage      = quitB.ResizeBitmap;
            title.BackgroundImage           = titleL.ResizeBitmap;

            this.ClientSize      = new Size(900, 700);
            title.Top            = 10;
            playButton.Left      = (this.ClientSize.Width - playButton.Width) / 2;
            playButton.Top       = title.Bottom + 30;
            highscoreButton.Left = (this.ClientSize.Width - highscoreButton.Width) / 2;
            highscoreButton.Top  = playButton.Bottom + 20;
            quitButton.Left      = (this.ClientSize.Width - quitButton.Width) / 2;
            quitButton.Top       = highscoreButton.Bottom + 20;
            title.Left           = (this.ClientSize.Width - title.Width) / 2;

            background = new GameImage(Properties.Resources.background, 400, 700);
            backGround = background.ResizeBitmap;

            kurbi = new AnimationImage(Properties.Resources.kurbi_run, 8, 20.0f, 600, 150);
            kurbi.setPosition(400, 450);

            previousTime = DateTime.Now;
            SoundPlayer sound = new SoundPlayer(Properties.Resources.Green_Greens_1);

            sound.Play();
        }
コード例 #4
0
        private void SelectForm_Load(object sender, EventArgs e)
        {
            this.ClientSize = new Size(900, 700);
            single          = new GameImage(Properties.Resources.single, 150, 100);
            multi           = new GameImage(Properties.Resources.multi, 150, 100);

            easy   = new GameImage(Properties.Resources.easy, 200, 50);
            normal = new GameImage(Properties.Resources.normal, 200, 50);

            selectE = new GameImage(Properties.Resources.easy_s, 200, 50);
            selectN = new GameImage(Properties.Resources.normal_s, 200, 50);

            back  = new GameImage(Properties.Resources.backB, 200, 50);
            backS = new GameImage(Properties.Resources.s_backB, 200, 50);

            backButton.BackgroundImage         = back.ResizeBitmap;
            singleEasyButton.BackgroundImage   = easy.ResizeBitmap;
            singleNormalButton.BackgroundImage = normal.ResizeBitmap;
            multiEasyButton.BackgroundImage    = easy.ResizeBitmap;
            multiNormalButton.BackgroundImage  = normal.ResizeBitmap;

            background = new GameImage(Properties.Resources.background, 400, 700);
            backGround = background.ResizeBitmap;

            singleEasyButton.Left   = 200;
            singleEasyButton.Top    = 250;
            singleNormalButton.Left = 200;
            singleNormalButton.Top  = singleEasyButton.Bottom + 20;

            multiEasyButton.Left   = singleEasyButton.Right;
            multiEasyButton.Top    = singleEasyButton.Top;
            multiNormalButton.Left = singleNormalButton.Right;
            multiNormalButton.Top  = singleNormalButton.Top;

            singlePanel.BackgroundImage = single.ResizeBitmap;
            multiPanel.BackgroundImage  = multi.ResizeBitmap;
            singlePanel.Left            = 250;
            singlePanel.Top             = singleEasyButton.Top - 120;
            multiPanel.Left             = singlePanel.Right + 90;
            multiPanel.Top = singlePanel.Top;

            backButton.Left = (this.ClientSize.Width - backButton.Width) / 2;
            backButton.Top  = (multiNormalButton.Bottom + 20);

            kurbi = new AnimationImage(Properties.Resources.kurbi_role, 9, 8.0f, 600, 150);
            kurbi.setPosition(400, 450);

            previousTime = DateTime.Now;
        }