DanmakuJSON "rotate" Action

Rotates the bullet-source which executes this action.

Required Parameters

ParameterTypeDescription
angleTermThe target angle (in degrees)

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")
relationRelationSpecifies if the given angle is absolute or relative to the current rotation. (Default value: "relative")
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: 3,
        lifetime: 8,
        behaviour:
        [
            # Rotate by 90 degrees within one second... 
            {rotate: {angle: 90,
                      duration: 1,
                      wait: true}},

            # Smoothly rotate by -120 degrees
            # (counter clock-wise) within 1.5 seconds...
            {rotate: {angle: -120,
                      duration: 1.5,
                      interpolation: "easeInOutSine",
                      wait: true}}
        ]
    }
}

 


Leave a comment