Example #1
0
        public Enemy(Player player, GameScene gameScene)
        {
            //それぞれ初期化(追加)
            this.gameScene = gameScene;
            this.player    = player;

            //画像設定
            Texture        = Engine.Graphics.CreateTexture2D("Resource/leader_ibaru.png");
            CenterPosition = new Vector2DF(Texture.Size.X / 2.0f, Texture.Size.Y / 2.0f);
            Position       = new Vector2DF(240, 100);
            Scale          = new Vector2DF(0.2f, 0.2f);

            //初期化
            moveRight = true;
            hitted    = false;

            //初期化(追加)
            hitcount = 0;
            count    = 0;

            hp = 100;

            //当たり判定の半径(追加)
            radius = Texture.Size.X * Scale.X / 2f;

            //HP表示(追加)
            hpText = new HpText("敵のHP", new Vector2DF(0, 0), this, gameScene);
            gameScene.UILayer.AddObject(hpText);
        }
Example #2
0
        public Player(GameScene gameScene)
        {
            //ゲームシーン保持用(追加)
            this.gameScene = gameScene;

            //画像設定
            Texture        = Engine.Graphics.CreateTexture2D("Resource/icon_business_man01.png");
            CenterPosition = new Vector2DF(Texture.Size.X / 2.0f, Texture.Size.Y / 2.0f);
            Position       = new Vector2DF(240, 500);
            Scale          = new Vector2DF(0.2f, 0.2f);

            //HP設定(追加)
            hp = 5;

            //HP表示(追加)
            hpText = new HpText("自分のHP", new Vector2DF(0, Engine.WindowSize.Y - 30), this, gameScene);
            gameScene.UILayer.AddObject(hpText);

            //当たり判定の半径(追加)
            radius = Texture.Size.X * Scale.X / 32f;

            //初期化(追加)
            hitted   = false;
            hitcount = 0;
        }