Code: Select all
{
"id":"$my_heli00",
"type":"helicopter",
"frames":[{"bmp":"heli.png","w":38,"h":18,"count":4,"handle x":18,"handle y":16}], // 4 frames for the helicopter, handle defined the pivot point
"animation":[{
"id":"$rotor00","x":0,"y":-10
}]
}
For reference it's defined by
Code: Select all
{
"id":"$rotor00",
"type":"animation",
"frames":[
{"x":360,"y":526,"w":38,"h":9,"count":4,"handle x":18,"handle y":5},
{"x":360,"y":512,"w":38,"h":13,"count":4,"handle x":18,"handle y":6}
]
}
Code: Select all
{
"id":"$heliplaza00",
"type":"decoration",
"width":1,
"height":1,
"frames":[{"bmp":"heliport.png"}],
"build height":0, // Ensure correct building height so that helicopter will start at right height (zero = ground level)
"helicopter spawner":{ // Helicopter spawner object
"id":"$my_heli00", // Id of the helicopter to spawn
"radius":16 // Radius where they helicopter will fly randomly. Is 16 by default
}
}
In conclusion, the complete code for this sample plugin
Code: Select all
[
{
"id":"$my_heli00",
"type":"helicopter",
"frames":[{"bmp":"heli.png","w":38,"h":18,"count":4,"handle x":18,"handle y":16}],
"animation":[{
"id":"$rotor00","x":0,"y":-10
}]
},
{
"id":"$heliplaza00",
"type":"decoration",
"width":1,
"height":1,
"frames":[{"bmp":"heliport.png"}],
"build height":0,
"helicopter spawner":{
"id":"$my_heli00",
"radius":16
}
}
]