DanmakuJSON "shoot" Action

Shoots a bullet-source relative to the bullet-source which executes this action.

Optional Parameters

ParameterTypeDescription
angle TermThe angle of the bullet. (Default value: The angle-value in the bullet-source's defintion or 0.0 if it is not present)
angleOffset TermThe value which will be added to the angle of every successively spawned bullet-source if the parameter angleRelation is set to "cumulative". (Default value: 0.0)
angleRelation AngleRelationSpecifies in which relation the given angle is applied to the spawned bullet-source. (Default value: "relativeToSource")
bullet stringThe name of the bullet to be shot (Default value: "Default")
Note, that if emitter is passed and this parameter is omitted, no bullet will be spawned.
emitter stringThe name of the emitter to be spawned
speed TermThe speed of the bullet-source. (Default value: The speed-value in the bullet's defintion or 0.0 if it is not present)
speedOffset TermThe value which will be added to the speed of every successively spawned bullet-source if the parameter speedRelation is set to "cumulative". (Default value: 0.0)
speedRelation SpeedRelationSpecifies in which relation the given speed is applied to the spawned bullet-source. (Default value: "absolute")
variables VariableMapPasses a set of variables to the bullet-source which will be spawned

Remarks

Note, that you can omit the bullet-parameter if you want to use the pre-defined bullet-definition "Default". Also note, that no bullet will be spawned if you pass the emitter-parameter but omit the bullet-parameter.

Examples

root:
{
    repeatBehaviour: true,
    behaviour: 
    [
        {repeat: {times: 20, actions:
        [
            # Shoot the default bullet in
            # steps of 20 degrees per repetition
            {shoot: {angleOffset: 20,
                     angleRelation: "cumulative",
                     speed: 4}},

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

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

        {repeat: {times: 20, actions:
        [
            # Shoot the default bullet in
            # four directions
            {shoot: {angle: 0, speed: 4}},
            {shoot: {angle: 90, speed: 4}},
            {shoot: {angle: -90, speed: 4}},
            {shoot: {angle: 180, speed: 4}},

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

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

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

 


Leave a comment