Beispiel #1
0
        void initProc()
        {
            //nextSceneがNONEだったら、何もしない
            if (nextScene == SCENE.NONE)
            {
                return;
            }

            nowScene  = nextScene;
            nextScene = SCENE.NONE;

            switch (nowScene)
            {
            case SCENE.TITLE:
                label2.Visible  = true;
                button1.Visible = true;
                break;

            case SCENE.GAME:
                label2.Visible  = false;
                button1.Visible = false;
                getCount        = itemCount;
                break;
            }
        }
Beispiel #2
0
 public void draw(SCENE scene)
 {
     for (int i = 0; i < hpixels; i++)
     {
         for (int j = 0; j < vpixels; j++)
         {
             if (!(owner[i, j] is IColorOwner))
             {
                 odot[i, j].update(scene.time, null, null, 0f);
                 continue;
             }
             IColorOwner co  = (IColorOwner)owner[i, j];
             vec4        pos = v4(this.x + i * pixelsize, this.y + j * pixelsize, 1f, 1f);
             vec4        res = col(co.getColor(i, j, (int)pos.x, (int)pos.y, zbuf[i, j], uv[i, j]));
             if (res.x == 0f && res.y == 0f && res.z == 0f)
             {
                 // this somehow fixes things /shrug
                 odot[i, j].update(scene.time, null, null, 0f);
                 continue;
             }
             odot[i, j].update(scene.time, res, pos);
             odot[i, j].draw(scene.g);
         }
     }
 }
Beispiel #3
0
            public void update(SCENE scene, bool culled)
            {
                this.update_my_points();

                if (culled)
                {
                    this.rect.update_culled(scene);
                }
                else
                {
                    if (this.rect.is_fully_visible())
                    {
                        this.rect.update(scene, .3f, .7f, 1f);
                        culled = true;
                    }
                    else
                    {
                        this.rect.update_culled(scene);
                    }
                }

                foreach (MultiRectChild child in this.children)
                {
                    copy(child.parentpoints, this.mypoints);
                    child.update(scene, culled);
                }
            }
Beispiel #4
0
    public void GoToStageGate(bool pIsNextDoor)
    {
        int sceneNum = (int)_scene;

        //다음 스테이지로
        if (pIsNextDoor.Equals(true))
        {
            if (sceneNum < 18)
            {
                sceneNum += 1;
            }
            else
            {
                return;
            }
        }
        //이전 스테이지로
        else
        {
            if (sceneNum > 3)
            {
                sceneNum -= 1;
            }
            else
            {
                return;
            }
        }

        _scene = (SCENE)sceneNum;
        StartCoroutine(LoadScene("Dungeon_normal_" + (sceneNum - 2).ToString()));
    }
Beispiel #5
0
	public GameObject GetSceneData( SCENE scene )
	{
		if( !_sceneList.ContainsKey( scene ) )
			return null;

		return _sceneList[scene];
	}
Beispiel #6
0
        public Form1()
        {
            InitializeComponent();

            //SCENEを代入
            nowscene  = SCENE.NONE;
            nextscene = SCENE.TITLE;

            for (int i = 0; i < TOTAL_COUNT; i++)
            {
                //個々のlabelsの記憶領域確保
                labels[i] = new Label();

                //labels生成
                Controls.Add(labels[i]);

                //★全体の設定
                labels[i].AutoSize = true;
                labels[i].Visible  = false;

                //取っていいlabelsの設定
                if (i < ITEM_COUNT)
                {
                    labels[i].Text      = "★";
                    labels[i].ForeColor = Color.Tomato;
                }
                //取ってはいけないlabelsの設定
                else
                {
                    labels[i].Text      = "★";
                    labels[i].ForeColor = Color.Black;
                }
            }
        }
 public static void changeScene(string levelName)
 {
     switch (levelName)
     {
         case "Opening":
             {
                 text = "Opening";
                 SceneManager.scene = new Opening();
                 actualScene = SCENE.OPENING;
             }
             break;
         case "Level_01":
             {
                 text = "Level_01";
                 SceneManager.scene = new Level_01();
                 actualScene = SCENE.LEVEL_01;
             }
             break;
         case "GameOver":
             {
                 text = "GameOver";
                 SceneManager.scene = new GameOver();
                 actualScene = SCENE.GAMEOVER;
             }
             break;
         default:
             break;
     }
 }
Beispiel #8
0
    public static string GetSceneName(SCENE levelToLoad)
    {
        string sceneName = "";

        switch (levelToLoad)
        {
        case SCENE.PRISON:
            sceneName = SCENE_PRISON_STRING;
            break;

        case SCENE.MAIN_MENU:
            sceneName = SCENE_MAIN_MENU_STRING;
            break;

        case SCENE.SURVEY:
            sceneName = SCENE_SURVEY_STRING;
            break;

        case SCENE.PVP_1:
            sceneName = SCENE_PVP_1;
            break;

        case SCENE.PVP_2:
            sceneName = SCENE_PVP_2;
            break;

        case SCENE.PVP_3:
            sceneName = SCENE_PVP_3;
            break;
        }
        return(sceneName);
    }
Beispiel #9
0
 private void Awake()
 {
     scFSM = suspect.GetComponent <SuspectControllerFSM>();
     scFSM.setScenarioController(this);
     timer         = 0f;
     transitioning = false;
     GRS           = CC.GetComponent <GrammarRecognizerScript>();
     DM            = CC.GetComponent <DialogueManager>();
     CM            = CC.GetComponent <CameraMove>();
     Audio1        = Officer.GetComponent <AudioSource>();
     Audio2        = car.GetComponent <AudioSource>();
     playArea      = CC.GetComponentInChildren <SteamVR_PlayArea>();
     copAnim       = Officer.GetComponent <Animator>();
     JimAnim       = suspect.GetComponent <Animator>();
     GuardAnim     = guard.GetComponent <Animator>();
     BossAnim      = boss.GetComponent <Animator>();
     JimAC         = suspect.GetComponent <AnimController_Jim>();
     VRS           = CC.GetComponent <VoiceRecognizer_Scenario>();
     currentScene  = SCENE.INTRO;
     interrupt     = false;
     shot          = new int[4];
     suspectGun.SetActive(false);
     BuildingInside.SetActive(false);
     BuildingOutside.SetActive(false);
     results_cg.alpha = 0;
 }
Beispiel #10
0
 public void update_culled(SCENE scene)
 {
     for (int i = 0; i < tris.Length; i++)
     {
         tris[i].update(scene.time, null, 0f, null, v2(0f));
     }
 }
Beispiel #11
0
        public Form1()
        {
            //基本的に↓コレの下に書く
            InitializeComponent();

            nextScene = SCENE.TITLE;
            nowScene  = SCENE.NONE;

            for (int i = 0; i < itemCount; i++)
            {
                //メモリとして使うためこっちも大事
                labels[i]          = new Label();
                labels[i].AutoSize = true;
                labels[i].Text     = "○";
                Controls.Add(labels[i]);
                labels[i].Font      = label1.Font;
                labels[i].ForeColor = label1.ForeColor;
                labels[i].Left      = rand.Next(ClientSize.Width - label1.Width);
                labels[i].Top       = rand.Next(ClientSize.Height - label1.Height);
                vx[i] = rand.Next(-5, 6);
                vy[i] = rand.Next(-5, 6);
            }


            label1.Left = rand.Next(ClientSize.Width - label1.Width);
            label1.Top  = rand.Next(ClientSize.Height - label1.Height);
        }
Beispiel #12
0
            public override void draw(SCENE scene)
            {
                dp = v3(0f);
                float x = progressx(17100f, 48000, scene.time);

                x = eq_out_sine(x);
                float ry  = eq_in_out_sine(progressx(54000f, stop, scene.time) / 2f);
                float y   = 1f - ry;
                float amp = 120f;

                dp.x = -amp *sin(x *y *TWOPI);

                dp.y   = -amp + amp * cos(x * TWOPI);
                dp.z   = -amp / 2f * .6f * sin(x * TWOPI);
                dp.yz -= 120f * sin(y * PI);
                int mbt = Z.sync(47650, Ztunnel.FRAMEDELTA);

                moveback = 0f;
                if (scene.time > mbt)
                {
                    moveback  = clamp(progress(mbt, 49700f, scene.time), 0f, 1.75f);
                    moveback  = sin(moveback * PI2);
                    moveback *= 200f;
                }
                dp.y += moveback;
                dp.y -= moveback * sin(y * ry);
                vec2 vd = viewdir(campos, mid + dp);

                lquatx = quat(0f, 0f, vd.x);
                lquaty = quat(0f, vd.y, 0f);
            }
Beispiel #13
0
        public Form1()
        {
            InitializeComponent();

            //次のシーンと今のシーンを初期化
            nextScene = SCENE.TITLE;
            nowScene  = SCENE.NONE;

            for (int i = 0; i < num; i++)
            {
                //label 個々の設定用の記憶領域確保
                labels[i] = new Label();

                //labels の作成
                Controls.Add(labels[i]);

                //labels の設定
                labels[i].ForeColor = label1.ForeColor;
                labels[i].Text      = "🐜";
                labels[i].AutoSize  = true;

                //開始位置ランダム化
                labels[i].Left = rand.Next(ClientSize.Width - label1.Width);
                labels[i].Top  = rand.Next(ClientSize.Height - label1.Height);

                //開始速度ランダム化
                vx[i] = rand.Next(-10, 11);
                vy[i] = rand.Next(-10, 11);
            }
        }
Beispiel #14
0
            private void dotri(SCENE scene, Otri tri, vec2[] pts, vec2 phantom, int i, float w, vec4 col)
            {
                float rot  = angle(phantom, pts[2]) + PI;
                vec2  pos  = pts[2];
                vec2  size = v2(distance(phantom, pts[2]), distance(phantom, pts[i]));

                if (scale_factor != 1f)
                {
                    // note: this can't be square (100&100) because then square and non-square scale will interfere
                    // not sure if that's due to my code or osu! code, dunno, duncare
                    size = v2(lerp(100f, size.x, scale_factor), lerp(105f, size.y, scale_factor));
                }
                float d = angle(pts[i], phantom) - angle(pts[2], phantom);

                if (d > PI || (d < 0 && d > -PI))
                {
                    pos  = pts[i];
                    rot -= PI2;
                    size = v2(size.y, size.x);
                }
                if (position_factor != 1f)
                {
                    pos = lerp(custom_position, pos, position_factor);
                }
                tri.update(scene.time, col, rot * rotation_factor, v4(pos.x, pos.y, 1f, w), size);
                tri.draw(scene.g);
            }
Beispiel #15
0
        void initScene()
        {
            if (nextscene == SCENE.NONE)
            {
                return;
            }

            nowscene  = nextscene;
            nextscene = SCENE.NONE;

            switch (nowscene)
            {
            case SCENE.TITLE:
                titleLabel.Visible  = true;
                startButton.Visible = true;
                break;

            case SCENE.GAME:
                titleLabel.Visible  = false;
                startButton.Visible = false;
                left           = ITEM_COUNT;
                leftLabel.Text = "残り:" + left + "個";
                for (int i = 0; i < ITEM_COUNT; i++)
                {
                    labels[i].Visible = true;
                    labels[i].Left    = rand.Next(ClientSize.Width - labels[i].Width);
                    labels[i].Top     = rand.Next(ClientSize.Height - labels[i].Height);
                    vx[i]             = rand.Next(-5, 5);
                    vy[i]             = rand.Next(-5, 5);
                }
                break;
            }
        }
Beispiel #16
0
 public override void draw(SCENE scene)
 {
     turn(_points, points, mid, 800f * scene.progress, 1200f * scene.progress);
     screen.clear();
     cube.draw(screen);
     screen.draw(scene);
 }
Beispiel #17
0
 public override void draw(SCENE scene)
 {
     ICommand.round_move_decimals.Push(5);
     copy(_points, points);
     Zlc.adjust(_points);
     for (int i = rects2.Length - 1; i >= 0; i--)
     {
         if (!rects2[i].left.shouldcull())
         {
             orects2[i].update(scene);
         }
         else
         {
             orects2[i].update(scene, -1f, -1f, -1f);
         }
     }
     for (int i = 0; i < rects.Length; i++)
     {
         if (rects[i].left.shouldcull())
         {
             orects[i].update(scene);
         }
         else
         {
             orects[i].update(scene, -1f, -1f, -1f);
         }
     }
     ICommand.round_move_decimals.Pop();
 }
Beispiel #18
0
        public Form1()
        {
            InitializeComponent();
            nextScene = SCENE.TITLE;//起動時に呼び出す
            nowScene  = SCENE.NONE;

            //取るやつ、敵の設定
            for (int i = 0; i < TOTAL_COUNT; i++)
            {
                labels[i]          = new Label();
                labels[i].AutoSize = true;
                labels[i].Visible  = false;
                labels[i].Font     = new Font(labels[i].Font.OriginalFontName, 20);
                Controls.Add(labels[i]);
                if (i < ITEM_COUNT)//取るやつの設定
                {
                    labels[i].Text      = "★";
                    labels[i].ForeColor = Color.Orange;
                }
                else//敵の設定
                {
                    labels[i].Text      = "×";
                    labels[i].ForeColor = Color.Black;
                }
            }
        }
    public void SceneLoad(SCENE scene)
    {
        GameObject CreateScene = null;

        for (int i = 0; i < SceneLoadList.Count; i++)
        {
            if (SceneLoadList[i].name.Equals(scene.ToString()))
            {
                CreateScene = SceneLoadList[i];
                break;
            }
        }
        if (CreateScene == null)
        {
            CreateScene = Resources.Load("Scene/Scene" + scene.ToString()) as GameObject;
            if (CreateScene == null)
            {
                DebugLog.Error(DebugLog.LOG_TYPE.SCENE, scene.ToString() + " not find");
                return;
            }
            SceneLoadList.Add(CreateScene);
        }

        StartCoroutine(SceneLoadCorountine(CreateScene));
    }
Beispiel #20
0
    public void loadScene(SCENE scene)
    {
        switch (scene)
        {
        case SCENE.MAIN_MENU:
            SceneManager.LoadScene("MainMenu");
            break;

        case SCENE.MAZE:
            SceneManager.LoadScene("Maze");
            StartCoroutine(InitializeMaze());
            break;

        case SCENE.DEATH:
            SceneManager.LoadScene("You Died");
            break;

        case SCENE.GAME_OVER:
            SceneManager.LoadScene("GameOver");
            break;

        case SCENE.EXIT:
            Application.Quit();
            break;
        }
    }
Beispiel #21
0
    //씬 변경
    public void ChangeScene(int pNum)
    {
        string sceneName = "";

        if (pNum.Equals(1))
        {
            sceneName = "Main";
        }
        else if (pNum.Equals(2))
        {
            sceneName = "Main_skin";
        }
        else if (pNum > 2 && pNum < 18)
        {
            sceneName = "Dungeon_normal_" + (pNum - 2).ToString();
        }
        else if (pNum > 17 && pNum < 23)
        {
            sceneName = "Dungeon_boss_" + (pNum - 17).ToString();
        }
        else
        {
            Debug.Log("잘못된 씬 번호입니다.");
            return;
        }

        //같은 씬이 아니라면 씬 전환
        clickBarrier.SetActive(true);
        _scene = (SCENE)pNum;
        StartCoroutine(LoadScene(sceneName));
    }
Beispiel #22
0
    public void GoToBossGate(bool pIsNextDoor)
    {
        int sceneNum = (int)_scene;

        //보스 스테이지로
        if (pIsNextDoor.Equals(true))
        {
            if (sceneNum.Equals(5))
            {
                sceneNum = 18;
            }
            else if (sceneNum.Equals(8))
            {
                sceneNum = 19;
            }
            else if (sceneNum.Equals(11))
            {
                sceneNum = 20;
            }
            else if (sceneNum.Equals(14))
            {
                sceneNum = 21;
            }
            else if (sceneNum.Equals(17))
            {
                sceneNum = 22;
            }

            _scene = (SCENE)sceneNum;
            StartCoroutine(LoadScene("Dungeon_boss_" + (sceneNum - 17).ToString()));
        }
        //필드 스테이지로
        else
        {
            if (sceneNum.Equals(18))
            {
                sceneNum = 5;
            }
            else if (sceneNum.Equals(19))
            {
                sceneNum = 8;
            }
            else if (sceneNum.Equals(20))
            {
                sceneNum = 11;
            }
            else if (sceneNum.Equals(21))
            {
                sceneNum = 14;
            }
            else if (sceneNum.Equals(22))
            {
                sceneNum = 17;
            }

            _scene = (SCENE)sceneNum;
            StartCoroutine(LoadScene("Dungeon_normal_" + (sceneNum - 2).ToString()));
        }
    }
Beispiel #23
0
 public void update(SCENE scene)
 {
     this.child.parentpoints[0] = this.rect.pts[this.rect.a];
     this.child.parentpoints[1] = this.rect.pts[this.rect.b];
     this.child.parentpoints[2] = this.rect.pts[this.rect.c];
     this.child.parentpoints[3] = this.rect.pts[this.rect.d];
     this.child.update(scene, false);
 }
Beispiel #24
0
 private void Start()
 {
     alpha      = 0.0f;
     _scene     = SCENE.TITLE;
     _isStarted = false;
     clickBarrier.SetActive(false);
     Init();
 }
Beispiel #25
0
            public override void draw(SCENE scene)
            {
                turn(_points, points, mid, 800f * scene.progress, 1200f * scene.progress);

                float ang       = scene.progress * 20f;
                vec3  light1pos = mid + v3(30f * sin(ang), 20f * cos(ang), 20f);
                vec3  light1col = v3(1f, 0f, 0f);

                light1.update(scene.time, v4(light1col, 1f), project(light1pos), 12f);
                light1.draw(scene.g);

                vec3 light2pos = mid + v3(30f * sin(ang * 1.7f), 0f, 20f * cos(ang * 1.7f));

                light2pos = turn(light2pos, mid, quat(rad(45f), rad(0f), 0f));
                vec3 light2col = v3(0f, 0f, 1f);

                light2.update(scene.time, v4(light2col, 1f), project(light2pos), 12f);
                light2.draw(scene.g);

                vec3 light3pos = mid + v3(30f * sin(ang * 0.5f), 0f, 20f * cos(ang * 0.5f));

                light3pos = turn(light3pos, mid, quat(0f, rad(-45f), 0f));
                vec3 light3col = v3(0f, .4f, 0f);

                light3.update(scene.time, v4(light3col, 1f), project(light3pos), 12f);
                light3.draw(scene.g);

                for (int i = 0; i < 6; i++)
                {
                    Rect  r = cube.rects[i];
                    Orect o = rects[i];

                    vec3 rectmid = v3(0f);
                    rectmid += r.pts[r.a];
                    rectmid += r.pts[r.b];
                    rectmid += r.pts[r.c];
                    rectmid += r.pts[r.d];
                    rectmid /= 4f;


                    float aval = 0.3f;
                    float bval = 0.7f;

                    vec3 result = col(r.color).xyz *aval;
                    result += light1col * bval / pow(distance(light1pos, rectmid) / 15, 2);
                    result += light2col * bval / pow(distance(light2pos, rectmid) / 15, 2);
                    result += light3col * bval / pow(distance(light3pos, rectmid) / 15, 2);

                    result.x = min(1f, result.x);
                    result.y = min(1f, result.y);
                    result.z = min(1f, result.z);

                    Color original = r.color;
                    r.setColor(v4(result, 1f).col());
                    o.update(scene);
                    r.setColor(original);
                }
            }
Beispiel #26
0
            public override void draw(SCENE scene)
            {
                float r     = (scene.time / framedelta) % 2 == 1 ? 1f : 0f;
                vec4  color = v4(v3(r, 0f, 1f), 1f);
                vec4  pos   = v4(100f, 100f, 1f, 10f);

                dot.update(scene.time, color, pos, 6f);
                dot.draw(scene.g);
            }
Beispiel #27
0
    public void SceneChange(SCENE state, BOSS boss = BOSS.NONE)
    {
        m_NextScene    = state;
        m_currentScene = SCENE.LOAD;
        m_BOSSScene    = boss;

        m_cAsyncOP = SceneManager.LoadSceneAsync("Loading");
        m_cAsyncOP.allowSceneActivation = true;
    }
Beispiel #28
0
 private void Awake()
 {
     DontDestroyOnLoad(this.gameObject);
     sceneNow   = SCENE.SCENE_TITLE;
     sceneBefor = SCENE.SCENE_TITLE;
     fade       = true;
     fadeIn     = true;
     fadeSpeed  = 1.0f / fadeSecond / 60.0f;
 }
        static public void ChangeScene(Game game)
        {
            game.Components.Clear();

            switch (SceneManager.currentScene)
            {
            case SCENE.SCN_OPENING:
                SceneManager.scene        = new Level01(game);
                SceneManager.currentScene = SCENE.SCN_LEVEL_01;
                break;

            case SCENE.SCN_LEVEL_01:
                SceneManager.scene        = new Level02(game);
                SceneManager.currentScene = SCENE.SCN_LEVEL_02;
                break;

            case SCENE.SCN_LEVEL_02:
                SceneManager.scene        = new Level03(game);
                SceneManager.currentScene = SCENE.SCN_LEVEL_03;
                break;

            case SCENE.SCN_LEVEL_03:
                SceneManager.scene        = new Level04(game);
                SceneManager.currentScene = SCENE.SCN_LEVEL_04;
                break;

            case SCENE.SCN_LEVEL_04:
                SceneManager.scene        = new Level05(game);
                SceneManager.currentScene = SCENE.SCN_LEVEL_05;
                break;

            case SCENE.SCN_LEVEL_05:
                SceneManager.scene        = new Level06(game);
                SceneManager.currentScene = SCENE.SCN_LEVEL_06;
                break;

            case SCENE.SCN_LEVEL_06:
                SceneManager.scene        = new Congrats(game);
                SceneManager.currentScene = SCENE.SCN_CONGRATS;
                break;

            case SCENE.SCN_CONGRATS:
            case SCENE.SCN_GAMEOVER:
                SceneManager.scene        = new Opening(game);
                SceneManager.currentScene = SCENE.SCN_OPENING;
                break;

            default:
                SceneManager.scene        = new Opening(game);
                SceneManager.currentScene = SCENE.SCN_OPENING;
                Console.WriteLine("SCENEMANAGER: OCORREU UM ERRO");
                break;
            }

            game.Components.Add(SceneManager.scene);
        }
Beispiel #30
0
            public override void draw(SCENE scene)
            {
                dp = v3(0f);
                vec3  dir = v3(0f);
                float rz  = 0f;

                if (scene.time < T2)
                {
                    float pr = progress(T1, T2, scene.time);
                    vec3  fr = v3(Zltext.SIZE * 25, 5f, -10f);
                    vec3  to = v3(Zltext.SIZE * -15, 40f, -10f);
                    dp += lerp(fr, to, pr);
                    fr  = v3(1f, 0f, 0f);
                    to  = v3(-.3f, 1f, 0f);
                    dir = lerp(fr, to, pr);
                    rz  = lerp(-PI2, 0, pr);
                }
                else if (scene.time < T3)
                {
                    dir = v3(0f, 1f, 0f);
                    float pr = progress(T2, T3, scene.time);
                    vec3  fr = v3(Zltext.SIZE * -20, 25f, -10f);
                    vec3  to = v3(Zltext.SIZE * 15, 25f, -10f);
                    dp += lerp(fr, to, pr);
                }
                else if (scene.time < T4)
                {
                    float pr      = progress(T3, T4, scene.time);
                    float frangle = -PI2;
                    float toangle = PI4;
                    vec3  fr      = v3(0f, 25f + 10f * cos(frangle), -10f + 10f * sin(frangle));
                    vec3  to      = v3(0f, 25f + 10f * cos(toangle), -10f + 10f * sin(toangle));
                    dp += lerp(fr, to, pr);
                    dir = dp - v3(0f, 0f, -10f);
                    float fx = 25;
                    float tx = -5;
                    dp.x = lerp(fx, tx, eq_cub(pr, v2(.5f, .6f), v2(.9f, 1f))) * Zltext.SIZE;
                    rz   = PI4 / 3f;
                }
                else
                {
                    float pr = progress(T4, T5, scene.time);
                    vec3  fr = v3(Zltext.SIZE * -35, 25f, -10f);
                    vec3  to = v3(Zltext.SIZE * 35, 25f, -10f);
                    dp += lerp(fr, to, eq_cub(pr, v2(.2f, .4f), v2(.9f, .6f)));
                    dir = dp - v3(0f, 0f, -10f);
                    //rz = lerp(-PI2, 0, pr);
                    rz = 0f;
                }

                vec2 vd = viewdir(dir);

                lquatx = quat(0f, 0f, vd.x);
                lquaty = quat(0f, vd.y, 0f);
                lquatz = quat(rz, 0f, 0f);
            }
Beispiel #31
0
        void updateScene()
        {
            if (nowScene != SCENE.GAME)//ゲーム画面での動き
            {
                return;
            }

            ti++;
            timeLabel.Text = "Time:" + ti;//経過時間

            for (int i = 0; i < TOTAL_COUNT; i++)
            {
                labels[i].Left += vx[i];
                labels[i].Top  += vy[i]; //取るやつ、敵が動く
                if (labels[i].Left < 0)  //以下、画面端の跳ね返り処理
                {
                    vx[i] = Math.Abs(vx[i]);
                }
                if (labels[i].Right > ClientSize.Width)
                {
                    vx[i] = -Math.Abs(vx[i]);
                }
                if (labels[i].Top < 0)
                {
                    vy[i] = Math.Abs(vy[i]);
                }
                if (labels[i].Bottom > ClientSize.Height)
                {
                    vy[i] = -Math.Abs(vy[i]);
                }
                Point mp = PointToClient(MousePosition);
                if (labels[i].Left <mp.X &&
                                    labels[i].Right> mp.X &&
                    labels[i].Top <mp.Y &&
                                   labels[i].Bottom> mp.Y) //マウスが重なったら
                {
                    if (i < ITEM_COUNT)                    //取るやつをとる
                    {
                        if (labels[i].Visible == true)
                        {
                            left--;
                        }
                        labels[i].Visible = false;
                        leftLabel.Text    = "残り:" + left + "個";
                        if (left == 0)//全部取るとクリア
                        {
                            nextScene = SCENE.CLEAR;
                        }
                    }
                    else//敵に当たるとゲームオーバー
                    {
                        nextScene = SCENE.GAMEOVER;
                    }
                }
            }
        }
Beispiel #32
0
            public override void draw(SCENE scene)
            {
                ICommand.round_move_decimals.Push(5);
                for (int i = 0; i < NBARS; i++)
                {
                    pcubes[i].setheight(MAXHEIGHT * smoothen(fft.smoothframe.values[i], scene));
                }
                copy(_points, points);
                vec3[] __points = new vec3[points.Length];
                copy(__points, _points);
                bool[] skiprect = new bool[orects.Length];
                for (int i = 0; i < NBARS; i++)
                {
                    int L = 3;             // see int[] order
                    int R = 1;             // see int[] order
                    if (i < NBARS - 1)
                    {
                        int  ridx  = reorder(i * 6 + R);
                        int  lidx  = reorder((i + 1) * 6 + L);
                        Rect lrect = orects[lidx].rect;
                        Rect rrect = orects[ridx].rect;
                        lrect.tri1.points = lrect.tri2.points = lrect.pts = __points;
                        rrect.tri1.points = rrect.tri2.points = rrect.pts = __points;
                        if (lrect.pts[lrect.a].z < rrect.pts[rrect.a].z)
                        {
                            rrect.pts[rrect.c].z = lrect.pts[lrect.a].z;
                            rrect.pts[rrect.d].z = lrect.pts[lrect.a].z;
                            skiprect[lidx]       = true;
                        }
                        else
                        {
                            lrect.pts[lrect.c].z = rrect.pts[rrect.a].z;
                            lrect.pts[lrect.d].z = rrect.pts[rrect.a].z;
                            skiprect[ridx]       = true;
                        }
                    }
                }
                Zsc.adjust(_points);
                Zsc.adjust(__points);
                int z = -1;

                foreach (Orect r in orects)
                {
                    z++;
                    Cube cube = cubes[reorder(z) / 6];
                    if (shoulddrawcube(cube) && !skiprect[z])
                    {
                        r.update(scene);
                    }
                    else
                    {
                        r.update(scene, -1f, -1f, -1f);
                    }
                }
                ICommand.round_move_decimals.Pop();
            }
Beispiel #33
0
	public void LoadScene( SCENE scene )
	{
		if( !_sceneList.ContainsKey( scene ) )
		{
			GameObject obj = Instantiate( DataManager.Instance.DataScene.GetSceneData( scene ) );
			_sceneList.Add( scene, obj );
		}

		_sceneList[scene].SetActive( true );

		if( !_currentScene.Equals( SCENE.SCENE_NONE ) )
			_sceneList[_currentScene].SetActive( false );

		_currentScene = scene;
	}
Beispiel #34
0
        /// <summary>
        /// ワールドの更新、衝突判定、入力値の取得、オーディオの再生などの
        /// ゲーム ロジックを、実行します。
        /// </summary>
        /// <param name="gameTime">ゲームの瞬間的なタイミング情報</param>
        protected override void Update(GameTime gameTime)
        {
            // ゲームの終了条件をチェックします。
            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
                this.Exit();

            if (scene == SCENE.INIT)
            {
                Random rnd = new Random();
                int w = img[(int)IMG.OPEN_BOX].Width;
                int h = img[(int)IMG.OPEN_BOX].Height;
                int y = (graphics.PreferredBackBufferHeight - h) / 2;
                int x = (graphics.PreferredBackBufferWidth - (w * box.Length)) / 2;

                // 状態を初期化
                for (int i = 0; i < box.Length; i++)
                {
                    box[i] = new Box();
                    box[i].status = Box.STATUS.MISS;
                    box[i].rect.Width = w;
                    box[i].rect.Height = h;
                    box[i].rect.X = 60 + ((w + 40) * i);
                    box[i].rect.Y = y;
                }
                box[rnd.Next(0, box.Length - 1)].status = Box.STATUS.HIT;
                shuffleAnimations = new Queue<ShuffleAnimation>();
                scene = SCENE.READY;
            }
            else if (scene == SCENE.READY)
            {
                // タッチを検出
                while (TouchPanel.IsGestureAvailable)
                {
                    GestureSample gs = TouchPanel.ReadGesture();
                    if (gs.GestureType == GestureType.Tap)
                    {
                        // シャッフル
                        int[] shuffle;
                        int frameCount = 120 - ((level - 1) * 30);
                        int times = (3 + level > 8 ? 8 : 3 + level);
                        ShuffleAnimation anim;
                        for (int i = 0; i < times; i++)
                        {
                            anim = new ShuffleAnimation();
                            shuffle = Enumerable.Range(0, box.Length).ToArray().OrderBy(n => Guid.NewGuid()).ToArray();
                            anim.Initialize(img[(int)IMG.CLOSE_BOX], ref box[shuffle[0]], ref box[shuffle[1]], (frameCount < 20 ? 20 : frameCount), Color.White, 1.0f);
                            shuffleAnimations.Enqueue(anim);
                        }
                        animation = shuffleAnimations.Dequeue();
                        scene = SCENE.SHUFFLE;
                    }
                }
            }
            else if (scene == SCENE.SHUFFLE)
            {
                // シャッフルアニメーション処理
                if (animation.Active)
                {
                    animation.Update(gameTime.ElapsedGameTime);
                }
                if (shuffleAnimations.Count <= 0)
                {
                    scene = SCENE.SELECT;
                }
            }
            else if (scene == SCENE.SELECT)
            {
                Rectangle rect;

                // タッチを検出
                while (TouchPanel.IsGestureAvailable)
                {
                    GestureSample gs = TouchPanel.ReadGesture();
                    if (gs.GestureType == GestureType.Tap)
                    {
                        rect = new Rectangle((int)gs.Position.X, (int)gs.Position.Y, 10, 10);
                        for (int i = 0; i < box.Length; i++)
                        {
                            if (rect.Intersects(box[i].rect))
                            {
                                scene = (box[i].status == Box.STATUS.HIT ? SCENE.WIN : SCENE.LOSE);
                            }

                        }
                    }
                }
            }
            else if ((scene == SCENE.WIN) || (scene == SCENE.LOSE))
            {
                // タッチを検出
                while (TouchPanel.IsGestureAvailable)
                {
                    GestureSample gs = TouchPanel.ReadGesture();
                    if (gs.GestureType == GestureType.Tap)
                    {
                        if (scene == SCENE.WIN)
                        {
                            level++;
                        }
                        else
                        {
                            level = 1;
                        }
                        scene = SCENE.INIT;
                    }
                }
            }

            base.Update(gameTime);
        }
 public static void Setup()
 {
     text = "OPENING";
     SceneManager.scene = new Opening();
     actualScene = SCENE.OPENING;
 }
 public static void changeScene(int level)
 {
     switch (level)
     {
         case 0:
             {
                 SceneManager.scene = new Opening();
                 scene.LoadContent(content);
                 actualScene = SCENE.OPENING;
             }
             break;
         case 1:
             {
                 SceneManager.scene = new GameLevel();
                 scene.LoadContent(content);
                 actualScene = SCENE.LEVEL_01;
             }
             break;
         case 2:
             {
                 SceneManager.scene = new GameOver();
                 scene.LoadContent(content);
                 actualScene = SCENE.GAMEOVER;
             }
             break;
         case 3:
             {
                 SceneManager.scene = new Menu();
                 scene.LoadContent(content);
                 actualScene = SCENE.MENU;
             }
             break;
         case 4:
             {
                 SceneManager.scene = new Instructions();
                 scene.LoadContent(content);
                 actualScene = SCENE.INSTRUCTIONS;
             }
             break;
         case 5:
             {
                 SceneManager.scene = new Creditos();
                 scene.LoadContent(content);
                 actualScene = SCENE.CREDITOS;
             }
             break;
         case 6:
             {
                 SceneManager.scene = new Congrats();
                 scene.LoadContent(content);
                 actualScene = SCENE.CONGRATS;
             }
             break;
         case 7:
             {
                 SceneManager.scene = new GameOver();
                 scene.LoadContent(content);
                 actualScene = SCENE.GAMEOVER;
             }
             break;
     }
 }
Beispiel #37
0
        /// <summary>
        /// ワールドの更新、衝突判定、入力値の取得、オーディオの再生などの
        /// ゲーム ロジックを、実行します。
        /// </summary>
        /// <param name="gameTime">ゲームの瞬間的なタイミング情報</param>
        protected override void Update(GameTime gameTime)
        {
            // ゲームの終了条件をチェックします。
            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
                this.Exit();

            if (scene == SCENE.INIT)
            {
                // 初期化
                flayer.pos.X = graphics.PreferredBackBufferWidth / 2;
                flayer.pos.Y = graphics.PreferredBackBufferHeight / 2;
                score = 0;
                scene = SCENE.TITLE;
            }
            else if (scene == SCENE.TITLE)
            {
                // タッチを検出
                while (TouchPanel.IsGestureAvailable)
                {
                    GestureSample gs = TouchPanel.ReadGesture();
                    if (gs.GestureType == GestureType.Tap)
                    {
                        scene = SCENE.PLAY;
                    }
                }
            }
            else if (scene == SCENE.PLAY)
            {
                // 衝突判定
                Rectangle[] rect = new Rectangle[2];
                rect[0] = new Rectangle((int)flayer.pos.X, (int)flayer.pos.Y, flayer.img.Width, flayer.img.Height);
                rect[1] = new Rectangle((int)gold.pos.X, (int)gold.pos.Y, gold.img.Width, gold.img.Height);
                if (rect[0].Intersects(rect[1]))
                {
                    score += Gold.SCORE_POINT;
                    gold.pos = this.GetRandomPos();
                    enemy.pos = this.GetRandomPos();
                }
                rect[1] = new Rectangle((int)silver[0].pos.X, (int)silver[0].pos.Y, silver[0].img.Width, silver[0].img.Height);
                if (rect[0].Intersects(rect[1]))
                {
                    score += Silver.SCORE_POINT;
                    silver[0].pos = this.GetRandomPos();
                    enemy.pos = this.GetRandomPos();
                }
                rect[1] = new Rectangle((int)silver[1].pos.X, (int)silver[1].pos.Y, silver[1].img.Width, silver[1].img.Height);
                if (rect[0].Intersects(rect[1]))
                {
                    score += Silver.SCORE_POINT;
                    silver[1].pos = this.GetRandomPos();
                    enemy.pos = this.GetRandomPos();
                }
                rect[1] = new Rectangle((int)enemy.pos.X, (int)enemy.pos.Y, enemy.img.Width, enemy.img.Height);
                if (rect[0].Intersects(rect[1]))
                {
                    scene = SCENE.GAMEOVER;
                }
            }
            else if (scene == SCENE.GAMEOVER)
            {
                // タッチを検出
                while (TouchPanel.IsGestureAvailable)
                {
                    GestureSample gs = TouchPanel.ReadGesture();
                    if (gs.GestureType == GestureType.Tap)
                    {
                        scene = SCENE.INIT;
                    }
                }
            }

            base.Update(gameTime);
        }