예제 #1
0
 //クリックの画像変更とか、clicknumberの変更してくれる,Object生成はClickSystem
 protected void TextureSystem()
 {
     if (asd.Engine.Mouse.LeftButton.ButtonState == (asd.MouseButtonState.Push))
     {
         if (ClickSystem.Select() == TextureNum)
         {
             if (ClickSystem.ClickedNumber == TextureNum)
             {
                 return;
             }
             //画像クリックで透明化
             asd.Engine.Sound.Play(Click);
             Color = new asd.Color(255, 255, 255, 100);
             ClickSystem.ClickedNumber = TextureNum;
         }
         else if (ClickSystem.Select() == -1 || ClickSystem.Select() == -2)
         {
             //画像そのまま
         }
         else
         {
             Color = new asd.Color(255, 255, 255, 255);
         }
     }
 }
예제 #2
0
        protected override void OnRegistered()
        {
            ClickSystem     = new ClickSystem();
            BackLayer       = new asd.Layer2D();
            GameLayer       = new asd.Layer2D();
            UILayer         = new asd.Layer2D();
            UnitText        = new asd.TextObject2D();
            StageText       = new asd.TextObject2D();
            ModeText        = new asd.TextObject2D();
            EnemyExists     = false;
            IsSceneChanging = false;
            IsStageMoving   = true;
            IsClear         = false;
            DequeueCount    = 100;
            if (TitleScene.HardMode)
            {
                RestCount = 10;
            }
            else
            {
                RestCount = 500;
            }

            if (TitleScene.EasyMode)
            {
                Money = 1500;
            }
            else
            {
                Money = 700;
            }

            Unit.unitlist     = new List <Unit>();
            GameOverSound     = asd.Engine.Sound.CreateSoundSource("gameover.wav", true);
            BGM               = asd.Engine.Sound.CreateSoundSource("bgm.wav", false);
            BGM.IsLoopingMode = true;
            PlayingBgmId      = null;

            AddLayer(GameLayer);
            AddLayer(UILayer);
            AddLayer(BackLayer);
            BackLayer.DrawingPriority = -1;
            GameLayer.DrawingPriority = 0;
            UILayer.DrawingPriority   = 1;
            var moneyText = new Money();

            // 説明文を生成する。
            var font = asd.Engine.Graphics.CreateDynamicFont("font.ttf", 18, new asd.Color(255, 255, 255, 255), 1, new asd.Color(0, 0, 0, 255));

            UnitText.Font     = font;
            UnitText.Position = new asd.Vector2DF(100, 610);
            UnitText.Text     = "";

            var stageFont = asd.Engine.Graphics.CreateDynamicFont("font.ttf", 30, new asd.Color(55, 255, 255, 150), 1, new asd.Color(0, 0, 0, 255));

            StageText.Font     = stageFont;
            StageText.Position = new asd.Vector2DF(10, 10);
            StageText.Text     = "Stage0";

            var modeFont = asd.Engine.Graphics.CreateDynamicFont("font.ttf", 20, new asd.Color(55, 255, 255, 10), 1, new asd.Color(0, 0, 0, 255));

            ModeText.Font     = modeFont;
            ModeText.Position = new asd.Vector2DF(10, 600);

            if (TitleScene.HardMode)
            {
                ModeText.Text = "Hard";
            }
            else if (TitleScene.EasyMode)
            {
                ModeText.Text = "かんたんもーど";
            }
            else
            {
                ModeText.Text = "";
            }

            //背景画像やらの配置
            asd.TextureObject2D textframe = new asd.TextureObject2D();
            textframe.Texture  = asd.Engine.Graphics.CreateTexture2D("TextFrame.png");
            textframe.Position = new asd.Vector2DF(0, 600);

            asd.TextureObject2D UIback = new asd.TextureObject2D();
            UIback.Texture  = asd.Engine.Graphics.CreateTexture2D("ButtonBack.png");
            UIback.Position = new asd.Vector2DF(600, 0);

            UILayer.AddObject(textframe);
            UILayer.AddObject(StageText);
            UILayer.AddObject(UIback);
            UILayer.AddObject(moneyText);
            UILayer.AddObject(UnitText);
            UILayer.AddObject(ModeText);
            Background = new asd.MapObject2D();
            for (int i = 0; i < 12; i++)
            {
                for (int j = 0; j < 12; j++)
                {
                    var chip = new asd.Chip2D();
                    chip.Texture  = asd.Engine.Graphics.CreateTexture2D("kusa.png");
                    chip.Position = new asd.Vector2DF(50 * i, 50 * j);
                    Background.AddChip(chip);
                }
            }
            GameLayer.AddObject(ClickSystem);
            BackLayer.AddObject(Background);
            UILayer.AddObject(new PlayerHP());
            UILayer.AddObject(new ButtonTexture(new asd.Vector2DF(600, 0), 0, "1509886607944.png"));
            UILayer.AddObject(new ButtonTexture(new asd.Vector2DF(700, 0), 1, "1509885962687.png"));
            UILayer.AddObject(new ButtonTexture(new asd.Vector2DF(600, 100), 2, "1509882889252.png"));
            UILayer.AddObject(new ButtonTexture(new asd.Vector2DF(700, 100), 3, "1509888733365.png"));
            UILayer.AddObject(new ButtonTexture(new asd.Vector2DF(600, 200), 4, "1509884775448.png"));
            UILayer.AddObject(new ButtonTexture(new asd.Vector2DF(700, 200), 5, "1509888645166.png"));
            UILayer.AddObject(new ButtonTexture(new asd.Vector2DF(600, 300), 6, "1509883808660.png"));
            UILayer.AddObject(new ButtonTexture(new asd.Vector2DF(700, 300), 7, "1509883676004.png"));
            UILayer.AddObject(new ButtonTexture(new asd.Vector2DF(600, 400), 8, "1509885496761.png"));
            UILayer.AddObject(new ButtonTexture(new asd.Vector2DF(700, 400), 9, "1509875815401.png"));
            UILayer.AddObject(new ButtonTexture(new asd.Vector2DF(600, 500), 10, "WallTexture.png"));
            UILayer.AddObject(new ButtonTexture(new asd.Vector2DF(700, 500), 11, "YellowWallTexture.png"));
            initAllStage();
        }