示例#1
0
        public override void UpdateLogic(OfficeWorld world, Time timeElapsed)
        {
            this.timeElapsed += timeElapsed;

            if (this.timeElapsed > periodPhase)
            {
                switch (this.moment)
                {
                case PrePhaseMoment.START:
                    AObject bubble = world.GetObjectFromId("bubble main");
                    bubble.SetAnimationIndex(1);

                    AObject toubib = world.GetObjectFromId("toubib main");
                    toubib.SetAnimationIndex(3);

                    this.moment      = PrePhaseMoment.BUBBLE_APPEARED;
                    this.periodPhase = Time.FromSeconds(1.2f);
                    this.timeElapsed = Time.Zero;
                    break;

                case PrePhaseMoment.BUBBLE_APPEARED:
                    DialogueObject dialogue = world.GetObjectFromId("dialogue coming") as DialogueObject;
                    dialogue.SetKinematicParameters(new Vector2f(-380f, dialogue.GetHeight(-150)), new Vector2f(0f, 0f));
                    dialogue.LaunchDialogue(1);

                    AObject queueTalk = world.GetObjectFromId("queueTalk main");
                    queueTalk.SetKinematicParameters(new Vector2f(100f, 100f), new Vector2f(0f, 0f));

                    bubble = world.GetObjectFromId("bubble main");
                    bubble.SetAnimationIndex(2);
                    this.moment = PrePhaseMoment.START_TALKING;
                    break;

                case PrePhaseMoment.TEXT_APPEARED:
                    dialogue = world.GetObjectFromId("dialogue coming") as DialogueObject;
                    dialogue.ResetDialogue();

                    bubble = world.GetObjectFromId("bubble main");
                    bubble.SetAnimationIndex(3);

                    queueTalk = world.GetObjectFromId("queueTalk main");
                    queueTalk.SetKinematicParameters(new Vector2f(10000, 10000), new Vector2f(0, 0));

                    this.timeElapsed = Time.Zero;
                    this.periodPhase = Time.FromSeconds(1);
                    this.moment      = PrePhaseMoment.END;
                    break;

                case PrePhaseMoment.END:
                    this.NodeState = NodeState.NOT_ACTIVE;
                    break;
                }
            }
        }
示例#2
0
        public override void VisitStart(OfficeWorld world)
        {
            base.VisitStart(world);

            AObject patient = world.GetObjectFromId("patient main");
            AObject toubib  = world.GetObjectFromId("toubib main");

            patient.SetAnimationIndex(3);
            toubib.SetAnimationIndex(2);

            DialogueObject dialogue = world.GetObjectFromId("dialogue patient") as DialogueObject;

            dialogue.ResetDialogue();
            //dialogue.SetKinematicParameters(new Vector2f(-100f, -200f), new Vector2f(0f, 0f));

            DialogueObject dialogueToubib = world.GetObjectFromId("dialogue toubib") as DialogueObject;

            dialogueToubib.SetKinematicParameters(new Vector2f(-380f, dialogueToubib.GetHeight(-150)), new Vector2f(0f, 0f));

            AObject queueTalk = world.GetObjectFromId("queueTalk main");

            queueTalk.SetKinematicParameters(new Vector2f(10000, 10000), new Vector2f(0f, 0f));

            AObject noteblock = world.GetObjectFromId("notebook main");

            (noteblock as NotebookObject).SetTransition(new Vector2f(-600, 600), new Vector2f(0, -150), Time.FromSeconds(3));

            AObject bubble = world.GetObjectFromId("bubble main");

            bubble.SetAnimationIndex(1);

            AObject timer = world.GetObjectFromId("timer main");

            timer.SetAnimationIndex(1);
            timer.SetKinematicParameters(new Vector2f(320, 200), new Vector2f(0f, 0f));

            this.periodPhase = Time.FromSeconds(1.2f);
            this.timeElapsed = Time.Zero;
        }
示例#3
0
        public override void VisitStart(OfficeWorld world)
        {
            base.VisitStart(world);

            AObject patient = world.GetObjectFromId("patient main");
            AObject toubib  = world.GetObjectFromId("toubib main");

            AObject bubble = world.GetObjectFromId("bubble main");

            //bubble.SetKinematicParameters(new Vector2f(-520f, -380f), new Vector2f(0f, 0f));

            patient.SetAnimationIndex(2);
            toubib.SetAnimationIndex(1);

            bubble.SetAnimationIndex(1);

            DialogueObject dialogue = world.GetObjectFromId("dialogue patient") as DialogueObject;

            dialogue.SetKinematicParameters(new Vector2f(-380f, dialogue.GetHeight(-150)), new Vector2f(0f, 0f));

            this.periodPhase = Time.FromSeconds(1.2f);
            this.timeElapsed = Time.Zero;
        }
示例#4
0
        public override void UpdateLogic(OfficeWorld world, Time timeElapsed)
        {
            this.timeElapsed += timeElapsed;

            if (this.timeElapsed > periodPhase)
            {
                DialogueObject dialogue = null;
                switch (this.moment)
                {
                    case ResolvePhaseMoment.START:
                        if (this.isSuccess)
                        {
                            dialogue = world.GetObjectFromId("dialogue successAnswer") as DialogueObject;
                        }
                        else
                        {
                            dialogue = world.GetObjectFromId("dialogue failAnswer") as DialogueObject;
                        }
                        dialogue.SetKinematicParameters(new Vector2f(-380f, dialogue.GetHeight(-150)), new Vector2f(0f, 0f));
                        dialogue.LaunchDialogue(2);

                        AObject queueTalk = world.GetObjectFromId("queueTalk main");
                        queueTalk.SetKinematicParameters(new Vector2f(-200f, 120f), new Vector2f(0f, 0f));

                        AObject bubble = world.GetObjectFromId("bubble main");
                        bubble.SetAnimationIndex(2);

                        this.timeElapsed = Time.Zero;
                        this.periodPhase = Time.FromSeconds(2);
                        this.moment = ResolvePhaseMoment.BUBBLE_APPEARED;
                        break;
                    case ResolvePhaseMoment.END_DIALOGUE:
                        AObject patient = world.GetObjectFromId("patient main");
                        if (this.isSuccess)
                        {
                            dialogue = world.GetObjectFromId("dialogue successAnswer") as DialogueObject;
                            patient.SetAnimationIndex(5);
                        }
                        else
                        {
                            dialogue = world.GetObjectFromId("dialogue failAnswer") as DialogueObject;
                            patient.SetAnimationIndex(4);
                        }
                        dialogue.ResetDialogue();

                        bubble = world.GetObjectFromId("bubble main");
                        bubble.SetAnimationIndex(3);

                        queueTalk = world.GetObjectFromId("queueTalk main");
                        queueTalk.SetKinematicParameters(new Vector2f(10000, 10000), new Vector2f(0, 0));

                        this.timeElapsed = Time.Zero;
                        this.periodPhase = Time.FromSeconds(2);
                        this.moment = ResolvePhaseMoment.END;
                        break;
                    case ResolvePhaseMoment.END:

                        if (this.isSuccess)
                        {
                            world.NotifyGameStateChanged(world.CurrentLevel.LevelName, new GameEvent(EventType.ENDING, "good"));
                        }
                        else
                        {
                            world.NotifyGameStateChanged(world.CurrentLevel.LevelName, new GameEvent(EventType.ENDING, "bad"));
                        }

                        this.NodeState = NodeState.NOT_ACTIVE;
                        break;
                }
            }
        }