DanmakuJSON "changeSpeed" Action

Changes the speed of the bullet-source which executes this action.

Required Parameters

ParameterTypeDescription
speedTermThe target speed

Optional Parameters

ParameterTypeDescription
durationTermThe duration (in seconds) of the transition from the current speed to the given target speed. (Default value: 0.0)
interpolationInterpolationTypeSpecifies which interpolation-algorithm will be used. (Default value: "linear")
waitbool

Specifies if the behaviour of the executing bullet-source will be paused until this action has finished (Default value: false)

 

Examples

root:
{
    repeatBehaviour: true,
    behaviour: 
    [
        # Shoot 20 bullets
        {repeat: {times: 20, actions:
        [
            # Shoot the default bullet
            shoot,

            # Wait for 0.3 seconds before continuing
            {wait: {duration: 0.3}},

            # Rotate the root-emitter by 18 degrees
            {rotate: {angle: 18}}
        ]}},

        # Wait for one second before continuing
        {wait: {duration: 1}}
    ]
},

bullets:
{
    Default:
    {
        speed: 7,
        lifetime: 4,
        behaviour:
        [
            # Decelerate to zero within 0.4 seconds... 
            {changeSpeed: {speed: 0,
                           duration: 0.4,
                           wait: true}},

            # Smoothly accelerate to 10 within one second...
            {changeSpeed: {speed: 10,
                           duration: 1,
                           interpolation: "easeInSine"}}

        ]
    }
}

 


Leave a comment