コード例 #1
0
        public override void step(FrmEmulator emulator, long time)
        {
            // process for accelerator sensibility actor
            if (this.acceleratorSensibility && !isMoving())
            {
                // elapsed time
                float elapsed = emulator.accelerationWatch.ElapsedMilliseconds / 1000.0f;

                // emulate acceleration
                PointF acceleration = new PointF(0f, 0.98f);
                run_xVelocity += acceleration.X * elapsed;
                run_yVelocity += acceleration.Y * elapsed;

                float xDelta = elapsed * run_xVelocity * 500;
                float yDelta = elapsed * run_yVelocity * 500;

                PointF point = this.parent.logicalToScreen(this.position);
                point.X += xDelta;
                point.Y += yDelta;

                // try assign location with new position
                this.position = this.parent.screenToLogical(point);

                // check collision of new bound with boundaries
                PointF d = collisionWithBoundaries(this.boundStraightOnScreen());

                // correct based on collision
                point.X += d.X;
                point.Y += d.Y;

                this.position = this.parent.screenToLogical(point);
            }

            base.step(emulator, time);
        }
コード例 #2
0
 // execute action for every frame
 // if action is finished, return true;
 public virtual bool step(FrmEmulator emulator, long time)
 {
     if (isInstant || run_startTime + duration <= time)
     {
         return(true);
     }
     return(false);
 }
コード例 #3
0
        // execute action for every frame
        // if action is finished, return true;
        public override bool step(FrmEmulator emulator, long time)
        {
            TActor targetActor = (TActor)emulator.currentScene.findLayer(actor);

            if (targetActor != null)
            {
                targetActor.fireEvent(eventu, recursive);
            }

            return(base.step(emulator, time));
        }
コード例 #4
0
        // execute action for every frame
        // if action is finished, return true;
        public override bool step(FrmEmulator emulator, long time)
        {
            TActor targetActor = (TActor)emulator.currentScene.findLayer(actor);

            if (targetActor != null)
            {
                targetActor.run_state = state;
            }

            return(base.step(emulator, time));
        }
コード例 #5
0
        // execute action for every frame
        // if action is finished, return true;
        public override bool step(FrmEmulator emulator, long time)
        {
            TActor targetActor = (TActor)emulator.currentScene.findLayer(actor);

            if (targetActor != null)
            {
                targetActor.stopAnimation(eventu, state);
            }

            return(base.step(emulator, time));
        }
コード例 #6
0
        public override void step(FrmEmulator emulator, long time)
        {
            base.step(emulator, time);

            // step of extra actors
            if (run_extraActors != null)
            {
                foreach (TActor actor in run_extraActors)
                {
                    actor.step(emulator, time);
                }
            }
        }
コード例 #7
0
        public void step(FrmEmulator emulator, long time)
        {
            bool progressing = false;

            for (int i = 0; i < sequences.Count; i++)
            {
                progressing |= sequences[i].step(emulator, time);
            }

            if (!progressing)
            {
                this.stop();
            }
        }
コード例 #8
0
        // execute action for every frame
        // if action is finished, return true;
        public override bool step(FrmEmulator emulator, long time)
        {
            float elapsed = time - run_startTime;

            if (elapsed > duration)
            {
                elapsed = duration;
            }

            TLayer layer = sequence.animation.layer;

            layer.alpha = run_easingFunction.ease(easingType, easingMode, duration, elapsed, run_startAlpha, run_endAlpha);

            return(base.step(emulator, time));
        }
コード例 #9
0
        public virtual void step(FrmEmulator emulator, long time)
        {
            // step of self
            for (int i = 0; i < animations.Count; i++)
            {
                TAnimation animation = animations[i];
                if (animation.run_executing)
                {
                    animation.step(emulator, time);
                }
            }

            // step of child
            for (int i = 0; i < childs.Count; i++)
            {
                childs[i].step(emulator, time);
            }
        }
コード例 #10
0
        // execute action for every frame
        // if action is finished, return true;
        public override bool step(FrmEmulator emulator, long time)
        {
            float elapsed = time - run_startTime;

            if (elapsed > duration)
            {
                elapsed = duration;
            }

            float percent = duration > 0 ? elapsed / duration : 1;

            if (runtimeCode != null)
            {
                runtimeCode(percent);
            }

            return(base.step(emulator, time));
        }
コード例 #11
0
        // execute action for every frame
        // if action is finished, return true;
        public override bool step(FrmEmulator emulator, long time)
        {
            float elapsed = time - run_startTime;

            if (elapsed > duration)
            {
                elapsed = duration;
            }

            TLayer layer = sequence.animation.layer;

            if (layer is TActor)
            {
                TActor target = (TActor)layer;
                target.rotation = TUtil.normalizeDegreeAngle(run_easingFunction.ease(easingType, easingMode, duration, elapsed, run_startAngle, run_endAngle));
            }

            return(base.step(emulator, time));
        }
コード例 #12
0
        // execute action for every frame
        // if action is finished, return true;
        public override bool step(FrmEmulator emulator, long time)
        {
            float elapsed = time - run_startTime;

            if (elapsed > duration)
            {
                elapsed = duration;
            }

            TLayer layer = sequence.animation.layer;

            if (layer is TActor)
            {
                TActor target = (TActor)layer;
                float  t      = run_easingFunction.ease(easingType, easingMode, duration, elapsed, 0, 1);
                target.position = bezier(t);
            }

            return(base.step(emulator, time));
        }
コード例 #13
0
        // execute action for every frame
        // if action is finished, return true;
        public override bool step(FrmEmulator emulator, long time)
        {
            TLayer layer = sequence.animation.layer;

            if (frames.Count > 0 && layer is TImageActor)
            {
                float elapsed = time - run_startTime;
                if (elapsed > duration)
                {
                    elapsed = duration;
                }

                long t     = 0;
                int  index = 0;
                while (t < elapsed && index < frames.Count)
                {
                    t += frames[index++].duration;
                }

                if (index > 0)
                {
                    index--;
                }

                if (index != run_currentFrame)
                {
                    run_currentFrame = index;
                    string image = frames[index].image;

                    TImageActor     target         = (TImageActor)layer;
                    TLibraryManager libraryManager = target.document.libraryManager;
                    int             libImageIndex  = libraryManager.imageIndex(image);
                    if (libImageIndex != -1)
                    {
                        target.loadImage(Image.FromFile(libraryManager.imageFilePath(libImageIndex)));
                    }
                }
            }

            return(base.step(emulator, time));
        }
コード例 #14
0
        // execute action for every frame
        // if action is finished, return true;
        public override bool step(FrmEmulator emulator, long time)
        {
            float elapsed = time - run_startTime;

            if (elapsed > duration)
            {
                elapsed = duration;
            }

            TLayer layer = sequence.animation.layer;

            if (layer is TActor)
            {
                TActor target = (TActor)layer;
                float  x      = run_easingFunction.ease(easingType, easingMode, duration, elapsed, run_startPos.X, run_endPos.X);
                float  y      = run_easingFunction.ease(easingType, easingMode, duration, elapsed, run_startPos.Y, run_endPos.Y);
                target.position = new PointF(x, y);
            }

            return(base.step(emulator, time));
        }
コード例 #15
0
        // execute action for every frame
        // if action is finished, return true;
        public override bool step(FrmEmulator emulator, long time)
        {
            float elapsed = time - run_startTime;

            if (elapsed > duration)
            {
                elapsed = duration;
            }

            TLayer layer = sequence.animation.layer;

            if (layer is TActor)
            {
                TActor target = (TActor)layer;
                float  width  = run_easingFunction.ease(easingType, easingMode, duration, elapsed, run_startScale.Width, run_endScale.Width);
                float  height = run_easingFunction.ease(easingType, easingMode, duration, elapsed, run_startScale.Height, run_endScale.Height);
                target.scale = new SizeF(width, height);
            }

            return(base.step(emulator, time));
        }
コード例 #16
0
        // execute action for every frame
        // if action is finished, return true;
        public override bool step(FrmEmulator emulator, long time)
        {
            switch (type)
            {
            case ActionType.PREVIOUS:
                emulator.gotoPrevScene();
                break;

            case ActionType.NEXT:
                emulator.gotoNextScene();
                break;

            case ActionType.COVER:
                emulator.gotoCoverScene();
                break;

            case ActionType.SPECIFIC:
                emulator.gotoSpecificScene(scene);
                break;
            }

            return(base.step(emulator, time));
        }
コード例 #17
0
        // execute action for every frame
        // if action is finished, return true;
        public override bool step(FrmEmulator emulator, long time)
        {
            emulator.stopAllSounds(bgm, effect, voice);

            return(base.step(emulator, time));
        }
コード例 #18
0
        // execute action for every frame
        // if action is finished, return true;
        public override bool step(FrmEmulator emulator, long time)
        {
            emulator.stopVoice(sound);

            return(base.step(emulator, time));
        }
コード例 #19
0
        // execute action for every frame
        // if action is finished, return true;
        public override bool step(FrmEmulator emulator, long time)
        {
            emulator.toggleEffect(false, enabled);

            return(base.step(emulator, time));
        }
コード例 #20
0
        // execute action for every frame
        // if action is finished, return true;
        public override bool step(FrmEmulator emulator, long time)
        {
            emulator.clearAvatar();

            return(base.step(emulator, time));
        }
コード例 #21
0
        // Execute Sequence for every frame
        // if sequence is progressing then return true
        // if sequence is done and finished then return false
        public bool step(FrmEmulator emulator, long time)
        {
            if ((repeat == -1 || run_repeated < repeat) && actions.Count > 0)
            {
                if (run_currentAction == -1)
                {
                    changeCurrentAction(0, time);
                }

                bool actionFinished = false;
                int  startingAction = run_currentAction;
                while (true)
                {
                    // execute action
                    actionFinished = actions[run_currentAction].step(emulator, time);

                    // if action finished, next action
                    if (actionFinished)
                    {
                        int  nextAction = run_currentAction + 1;
                        bool needNext   = false;

                        if (nextAction < actions.Count)
                        {
                            needNext = true;
                        }
                        else
                        {
                            if (repeat == -1)
                            {
                                nextAction = 0;
                                needNext   = true;
                            }
                            else if (run_repeated + 1 < repeat)
                            {
                                run_repeated++;
                                nextAction = 0;
                                needNext   = true;
                            }
                            else
                            {
                                run_repeated++;
                                needNext = false;
                            }
                        }

                        // go next action
                        if (needNext)
                        {
                            changeCurrentAction(nextAction, time);

                            // check endless loop
                            if (startingAction == nextAction)
                            {
                                return(true);
                            }
                        }
                        else
                        {
                            return(false);
                        }
                    }
                    else
                    {
                        return(true);
                    }
                }
            }

            return(false);
        }
コード例 #22
0
 // execute action for every frame
 // if action is finished, return true;
 public override bool step(FrmEmulator emulator, long time)
 {
     return(base.step(emulator, time));
 }
コード例 #23
0
        // execute action for every frame
        // if action is finished, return true;
        public override bool step(FrmEmulator emulator, long time)
        {
            emulator.playBGM(sound, volume);

            return(base.step(emulator, time));
        }