In case anyone curious about bullet pattern editor. The editor generates JSON files and The game read and saves them in HashMap<String, Vector> and gives a copy of it to any weapon or bullet when it needs.
Please check the example of the JSON file.
Example: - The weapon fires 11 bullets (Bullet-1). For each time it fire. It will rotate clockwise at 45 degrees.
- The Bullet-1 will change speed to 6 in 1000 milliseconds, wait for 400 milliseconds before spawning 10 bullets in a circle (Bullet-2) and destroy itself.
weapon preset json:Code:
[
{
"name": "weapon-1",
"bullet_preset": "bullet-1",
"commands": [
"int_rotate_cw:45",
"fire",
"step_back_countdown:2:10"
]
}
]
Bullet preset:Code:
{
"commands": [
{
"name": "bullet-1",
"commands": [
"set_speed_to:6:1000",
"wait:400",
"spawn_bullets_circle:bullet-2:2:10:36",
"remove"
]
}
],
"presets": [
{
"name": "bullet-1",
"config": "animation_name=bullet-01|scale=1|speed=0.5|damage=1|radius=6|health=1|life_time=1000",
"firing": "animation_name=bullet-firing-01|width=20.0|height=20.0|scale=1.4",
"hitting": "animation_name=bullet-bouncing-01|width=20.0|height=20.0|scale=1.0",
"bouncing": "animation_name=bullet-bouncing-01|width=20.0|height=20.0|scale=1.0",
"extra": "preset_name=bullet-1",
"command_name": "bullet-1"
},
{
"name": "bullet-2",
"config": "animation_name=bullet-03|scale=1|speed=4|damage=1|radius=6|health=1|life_time=1000",
"firing": "animation_name=bullet-firing-03|width=20.0|height=20.0|scale=1.4",
"hitting": "animation_name=bullet-bouncing-03|width=20.0|height=20.0|scale=1.0",
"bouncing": "animation_name=bullet-bouncing-03|width=20.0|height=20.0|scale=1.0",
"extra": "preset_name=",
"command_name": ""
}
]
}