Ejemplo n.º 1
0
 public static void Right(SpriteForTouchList spriteForTouches, float px)
 {
     foreach (SpriteForTouch spriteForTouch in spriteForTouches.Sprites) {
         spriteForTouch.Sprite.Quad.T.X += px;
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Stretch the specified spriteForTouches, x and y.
 /// 拡大縮小。引数値だけ+=;
 /// </summary>
 /// <param name='spriteForTouches'>
 /// Sprite for touches.
 /// </param>
 /// <param name='x'>
 /// X.
 /// </param>
 /// <param name='y'>
 /// Y.
 /// </param>
 public static void Stretch(SpriteForTouchList spriteForTouches, float x, float y)
 {
     foreach (SpriteForTouch spriteForTouch in spriteForTouches.Sprites) {
         spriteForTouch.Sprite.Quad.S.X += x;
         spriteForTouch.Sprite.Quad.S.Y += y;
     }
 }
Ejemplo n.º 3
0
 public static void Down(SpriteForTouchList spriteForTouches, float px)
 {
     foreach (SpriteForTouch spriteForTouch in spriteForTouches.Sprites) {
         spriteForTouch.Sprite.Quad.T.Y -= px;
     }
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Sets the scale.
 /// 画像のサイズをセットする。
 /// </summary>
 /// <param name='spriteForTouches'>
 /// Sprite for touches.
 /// </param>
 /// <param name='width'>
 /// Width.
 /// </param>
 /// <param name='height'>
 /// Height.
 /// </param>
 public static void SetScale(SpriteForTouchList spriteForTouches, float width, float height)
 {
     foreach (SpriteForTouch spriteForTouch in spriteForTouches.Sprites) {
         spriteForTouch.Sprite.Quad.S.X = width;
         spriteForTouch.Sprite.Quad.S.Y = height;
     }
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Sets the sprite positon grid y.
 /// 左上を0、下をプラスとしてY軸を作った時にグリッドの番号で
 /// sprite.Quad.T.Yに適切な値を返すメソッド
 /// </summary>
 /// <param name='spriteForTouches'>
 /// Sprite for touches.
 /// </param>
 /// <param name='grindNum'>
 /// Grind number.
 /// </param>
 public static void SetPositonGridY(SpriteForTouchList spriteForTouches, float grindNum)
 {
     foreach (SpriteForTouch spriteForTouch in spriteForTouches.Sprites) {
         spriteForTouch.Sprite.Quad.T.Y =
             (Const.GRID_SIZE*((float)System.Math.Floor(Const.GRID_NUM_Y)-grindNum) + Const.GRID_Y_REST) - spriteForTouch.Sprite.Quad.S.Y;
     }
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Sets the sprite positon grid x.
 /// 左上を0、下をプラスとしてX軸を作った時にグリッドの番号で
 /// sprite.Quad.T.Xに適切な値を返すメソッド
 /// </summary>
 /// <param name='spriteForTouches'>
 /// Sprite for touches.
 /// </param>
 /// <param name='grindNum'>
 /// Grind number.
 /// </param>
 public static void SetPositonGridX(SpriteForTouchList spriteForTouches, float grindNum)
 {
     foreach (SpriteForTouch spriteForTouch in spriteForTouches.Sprites) {
         spriteForTouch.Sprite.Quad.T.X = Const.GRID_SIZE*grindNum;
     }
 }
Ejemplo n.º 7
0
        /// <summary>
        /// Initialize of Scene.
        /// </summary>
        public override Scene Initialize()
        {
            scene.Camera.SetViewFromViewport();

            description = WriteString.DrawSprite("十字キー:移動/BallをTouch:色の変更" +
                "/Start:戻る",
                                        0.5f*Const.FIX,
                                        0.5f*Const.FIX,
                                        20,
                                        new ImageColor(255,255,255,255),
                                        scene);

            //画像のセット
            List<SpriteForTouch> ballList = new List<SpriteForTouch>();
            SpriteForTouch[] ballSpriteForTouch = new SpriteForTouch[this.ballSpriteNum];
            for(int i = 0; i < this.ballSpriteNum; i++) {
                ballSpriteForTouch[i] = new SpriteForTouch();
            }
            ballSpriteForTouch[0].DrawSprite("ball_blue_top.png", 9*Const.FIX, 4*Const.FIX,96f,96f);
            ballSpriteForTouch[1].DrawSprite("ball_blue_right.png", 9*Const.FIX, 4*Const.FIX,96f,96f);
            ballSpriteForTouch[2].DrawSprite("ball_blue_down.png", 9*Const.FIX, 4*Const.FIX,96f,96f);
            ballSpriteForTouch[3].DrawSprite("ball_blue_left.png", 9*Const.FIX, 4*Const.FIX,96f,96f);
            ballSpriteForTouch[4].DrawSprite("ball_red_top.png", 9*Const.FIX, 4*Const.FIX,96f,96f);
            ballSpriteForTouch[5].DrawSprite("ball_red_right.png", 9*Const.FIX, 4*Const.FIX,96f,96f);
            ballSpriteForTouch[6].DrawSprite("ball_red_down.png", 9*Const.FIX, 4*Const.FIX,96f,96f);
            ballSpriteForTouch[7].DrawSprite("ball_red_left.png", 9*Const.FIX, 4*Const.FIX,96f,96f);
            foreach (SpriteForTouch temp in ballSpriteForTouch) {
                ballList.Add(temp);
            }
            this.ball = new SpriteForTouchList(ballList,true);
            this.ball.AddToScene(scene);
            this.ballSpriteNum = this.ball.SetVisible(4);
            //画像のセットここまで

            return scene;
        }
Ejemplo n.º 8
0
        /// <summary>
        /// Initialize of Scene.
        /// </summary>
        public override Scene Initialize()
        {
            scene.Camera.SetViewFromViewport();

            background0.DrawSprite("haikei_ushiro.png",
                                    0,
                                    0,
                                    960,
                                    544,
                                    scene,
                                   	false);
            //敵_窓の外
            this.Teki_soto = new List<SpriteForTouchList>();
            //とりあえず5体ぐらい作る
            for (int i = 0; i < this.tekiNum ; i++) {
                //敵_木
                List<SpriteForTouch> teki_kiList = new List<SpriteForTouch>();
                SpriteForTouch[] teki_kiSpriteForTouch = new SpriteForTouch[ENEMY_ID_MAX];
                for(int k = 0; k < ENEMY_ID_MAX; k++) {
                    teki_kiSpriteForTouch[k] = new SpriteForTouch();
                }
                //アニメーション(各敵の種類

            //				teki_kiSpriteForTouch[0].DrawSprite("teki_ki.png", -240 * (i + 1), 10, 240f, 240f);
            //				teki_kiSpriteForTouch[1].DrawSprite("teki_ki.png", -240 * (i + 1), 10, 240f, 240f);

                //各対応した敵キャラクターをロード
                teki_kiSpriteForTouch[ENEMY_ID_MARU].DrawSprite("teki_ki.png", -240 * (i + 1), 10, 240f, 240f);
                teki_kiSpriteForTouch[ENEMY_ID_SANKAKU].DrawSprite("teki_hikui.png", -240 * (i + 1), 10, 240f, 240f);
                teki_kiSpriteForTouch[ENEMY_ID_SIKAKU].DrawSprite("teki_mizu.png", -240 * (i + 1), 10, 240f, 240f);
                teki_kiSpriteForTouch[ENEMY_ID_BATU].DrawSprite("teki_honoo.png", -240 * (i + 1), 10, 240f, 240f);

                foreach (SpriteForTouch temp in teki_kiSpriteForTouch) {
                    teki_kiList.Add(temp);
                }

                this.Teki_soto.Add(new SpriteForTouchList(teki_kiList,false));
                this.Teki_soto[i].AddToScene(scene);
                this.Teki_soto[i].SetVisible(0);
            }

            //画像の描画 960x544 //vita画面解像度 20x11.25(左上)
            //画像のセット
            //背景
            background1.DrawSprite("haikei.png",
                                    0,
                                    0,
                                    960,
                                    544,
                                    scene,
                                   	false);

            //			background.Sprite.Visible = false;

            //木
            List<SpriteForTouch> kiList = new List<SpriteForTouch>();
            SpriteForTouch[] kiSpriteForTouch = new SpriteForTouch[this.kiSpriteNum];
            for(int i = 0; i < this.kiSpriteNum; i++) {
                kiSpriteForTouch[i] = new SpriteForTouch();
            }
            kiSpriteForTouch[0].DrawSprite("ki.png", 450, 10,280f,340f);
            kiSpriteForTouch[1].DrawSprite("ki_kakure.png", 450, 10,280f,340f);

            foreach (SpriteForTouch temp in kiSpriteForTouch) {
                kiList.Add(temp);
            }
            this.Ki = new SpriteForTouchList(kiList,true);
            this.Ki.AddToScene(scene);
            this.Ki.SetVisible(0);

            //敵_木_扉
            List<SpriteForTouch> teki_ki_tobiraList = new List<SpriteForTouch>();
            SpriteForTouch[] teki_ki_tobiraSpriteForTouch = new SpriteForTouch[this.teki_tobiraSpriteNum];
            for(int i = 0; i < this.teki_tobiraSpriteNum; i++) {
                teki_ki_tobiraSpriteForTouch[i] = new SpriteForTouch();
            }
            teki_ki_tobiraSpriteForTouch[DOOR_OPEN_SANKAKU].DrawSprite("teki_hikui.png", 300, 10, 240f, 240f);
            teki_ki_tobiraSpriteForTouch[DOOR_OPEN_SIKAKU].DrawSprite("teki_mizu.png", 300, 10, 240f, 240f);
            teki_ki_tobiraSpriteForTouch[DOOR_OPEN_BATU].DrawSprite("teki_honoo.png", 300, 10, 240f, 240f);
            teki_ki_tobiraSpriteForTouch[DOOR_OPEN_MARU].DrawSprite("teki_ki.png", 300, 10, 240f, 240f);
            teki_ki_tobiraSpriteForTouch[DOOR_CLOSE].DrawSprite("tobira.png", 300, 10, 240f, 240f);

            foreach (SpriteForTouch temp in teki_ki_tobiraSpriteForTouch) {
                teki_ki_tobiraList.Add(temp);
            }
            this.Teki_tobira = new SpriteForTouchList(teki_ki_tobiraList,false);
            this.Teki_tobira.AddToScene(scene);
            this.teki_tobiraSpriteNum = this.Teki_tobira.SetVisible(DOOR_CLOSE);
            this.Teki_tobira.SetUnVisible();
            this.Teki_tobira.SetVisible(DOOR_CLOSE);

            //暖炉
            List<SpriteForTouch> danroList = new List<SpriteForTouch>();
            SpriteForTouch[] danroSpriteForTouch = new SpriteForTouch[this.danroSpriteNum];
            for(int i = 0; i < this.danroSpriteNum; i++) {
                danroSpriteForTouch[i] = new SpriteForTouch();
            }
            danroSpriteForTouch[0].DrawSprite("danro.png", 710, 215,250f,240f);
            danroSpriteForTouch[1].DrawSprite("danro_kakure.png", 710, 215,250f,240f);

            foreach (SpriteForTouch temp in danroSpriteForTouch) {
                danroList.Add(temp);
            }
            this.Danro = new SpriteForTouchList(danroList,true);
            this.Danro.AddToScene(scene);
            this.Danro.SetVisible(0);

            //ベッド
            List<SpriteForTouch> bedList = new List<SpriteForTouch>();
            SpriteForTouch[] bedSpriteForTouch = new SpriteForTouch[this.bedSpriteNum];
            for(int i = 0; i < this.bedSpriteNum; i++) {
                bedSpriteForTouch[i] = new SpriteForTouch();
            }
            bedSpriteForTouch[0].DrawSprite("bed.png", 450, 250, 260f, 185f);
            bedSpriteForTouch[1].DrawSprite("bed.png", 450, 250, 260f, 185f);

            foreach (SpriteForTouch temp in bedSpriteForTouch) {
                bedList.Add(temp);
            }
            this.Bed = new SpriteForTouchList(bedList,false);
            this.Bed.AddToScene(scene);
            this.Bed.SetVisible(0);

            //魔王
            List<SpriteForTouch> maouList = new List<SpriteForTouch>();
            SpriteForTouch[] maouSpriteForTouch = new SpriteForTouch[this.maouSpriteNum];
            for(int i = 0; i < this.maouSpriteNum; i++) {
                maouSpriteForTouch[i] = new SpriteForTouch();
            }
            maouSpriteForTouch[0].DrawSprite("maou.png", 520, 180,150f,180f);
            maouSpriteForTouch[1].DrawSprite("maou2.png", 520, 180,150f,180f);

            foreach (SpriteForTouch temp in maouSpriteForTouch) {
                maouList.Add(temp);
            }
            this.Maou = new SpriteForTouchList(maouList,false);
            this.Maou.AddToScene(scene);
            this.Maou.SetVisible(0);

            //カーペット
            List<SpriteForTouch> kapetList = new List<SpriteForTouch>();
            SpriteForTouch[] kapetSpriteForTouch = new SpriteForTouch[this.kapetSpriteNum];
            for(int i = 0; i < this.kapetSpriteNum; i++) {
                kapetSpriteForTouch[i] = new SpriteForTouch();
            }
            kapetSpriteForTouch[0].DrawSprite("karpet.png", 180, 305, 290f,150f);
            kapetSpriteForTouch[1].DrawSprite("karpet_kakure.png", 180, 305, 290f,150f);

            foreach (SpriteForTouch temp in kapetSpriteForTouch) {
                kapetList.Add(temp);
            }
            this.Kapet = new SpriteForTouchList(kapetList,true);
            this.Kapet.AddToScene(scene);
            this.Kapet.SetVisible(0);

            //池
            List<SpriteForTouch> ikeList = new List<SpriteForTouch>();
            SpriteForTouch[] ikeSpriteForTouch = new SpriteForTouch[this.ikeSpriteNum];
            for(int i = 0; i < this.ikeSpriteNum; i++) {
                ikeSpriteForTouch[i] = new SpriteForTouch();
            }
            ikeSpriteForTouch[0].DrawSprite("ike.png", 450, 397,305f,144f);
            ikeSpriteForTouch[1].DrawSprite("ike_kakure.png", 450, 397, 305f,144f);

            foreach (SpriteForTouch temp in ikeSpriteForTouch) {
                ikeList.Add(temp);
            }
            this.Ike = new SpriteForTouchList(ikeList,true);
            this.Ike.AddToScene(scene);
            this.Ike.SetVisible(0);

            //タイムバー
            timeBar.DrawSprite("lightBlue.png",
                                    10,
                                    500,
                                    300,
                                    30,
                                    scene,
                                   	false);
            //画像のセットここまで

            //効果音のセット
            this.doorCloseSe = Audio.SetEffect("/Application/sound/door_close.wav");
            this.doorOpenSe = Audio.SetEffect("/Application/sound/door_open.wav");
            this.endBadSe = Audio.SetEffect("/Application/sound/end_bad.wav");
            this.endGoodSe = Audio.SetEffect("/Application/sound/end_good.wav");
            this.fireSe = Audio.SetEffect("/Application/sound/fire.wav");
            this.landSe = Audio.SetEffect("/Application/sound/land.wav");
            this.waterSe = Audio.SetEffect("/Application/sound/water.wav");
            this.woodSe = Audio.SetEffect("/Application/sound/wood.wav");
            this.woodSe.Volume = 0.8f;

            //Bgmのセット
            Audio.SetBgm("/Application/sound/game_maoudamashii_6_dangeon07.mp3");
            Audio.SetVolumeBgm(0.1f);
            Audio.StartBgm();

            return scene;
        }