ProjectilePreset

@three-blocks/pro
const ProjectilePreset = { ARROW: { gravity: 1, drag: 0.01, speed: 40 }, GRENADE: { gravity: 1.5, drag: 0.05, speed: 15, aoeRadius: 5 }, ROCKE...
Value
{ ARROW: { gravity: 1, drag: 0.01, speed: 40 }, GRENADE: { gravity: 1.5, drag: 0.05, speed: 15, aoeRadius: 5 }, ROCKET: { gravity: 0.3, drag: 0, speed: 60, aoeRadius: 3 }, MORTAR: { gravity: 2, drag: 0.02, speed: 25, aoeRadius: 8 }, }

Preset configurations for common projectile types.

Use spread operator to apply presets to weapon fire options.

Example
import { WeaponType, ProjectilePreset } from '@three-blocks/pro';

// Fire an arrow with default arrow physics
physics.weapons.fire(towerIndex, {
  type: WeaponType.PROJECTILE,
  bodyType: 'kinematic',
  direction: aimDir,
  damage: 25,
  ...ProjectilePreset.ARROW,
});

// Fire a grenade with AoE
physics.weapons.fire(playerIndex, {
  type: WeaponType.PROJECTILE,
  bodyType: 'dynamic',
  direction: throwDir,
  damage: 100,
  ...ProjectilePreset.GRENADE,
});