Bombard Cannon Barrel

Type: Weapon Brain
Level: 2 star
Pages: 2
Description:  Designed to be used with the Bombard Cannon Barrel. When player interacts with a prop with this brain it fires a cannonball with a loud explosion and puff of smoke.

Kode

page 1 @Interacted – Shoot Cannon

  1. WHEN [once] DO [team][equals][team 1]
  2. WHEN [interacted] DO [shoot][prop: Cannonball][at speed][100]
  3. …WHEN DO [play fx][fx: Muzzle blast][at socket][fire point]
  4. …WHEN DO [play sound][sound: Weapon Artillery Fire][pitch][random number][negative][2][to][2][as integer][overlapping] // the pitch kode does absolutely nothing – remove it and see
  5. …WHEN DO [play sound][sound: Explosion Fire Small][volume][60][overlapping]
  6. …WHEN DO [switch page][page:@Cooldown]

page 2 @ Cooldown

  1. WHEN [countdown timer][1.5] DO [switch page][page: @Interacted – Shoot Cannon]

Alterations

Recoil
To get the cannon to move back and forth when it fires change everything to this. Looks good when you attach to a gun carriage. Have the wheels roll when the boolean [fire cannon] is active.

  1. WHEN [once] DO [team][equals][team 1]
  2. …WHEN DO [vectorvar: start][equals][position] // establishes the default position of the cannon
  3. WHEN [interacted] DO [boolvar: fire cannon][equals][true]
  4. WHEN [boolvar: fire cannon]
  5. …WHEN [duration timer][0.25] DO [move][object backward]
  6. …WHEN [countdown timer][0.25]
  7. …/…WHEN [duration timer][0.25] DO [move][object forward]
  8. …/…WHEN [countdown timer][0.25] DO [position][equals][vectorvar: start] // this ensures the cannon returns to the start position
  9. …WHEN [started to]
  10. …/…WHEN DO [shoot][prop: Cannonball][at speed][100]
  11. …/…WHEN DO [play fx][fx: Muzzle blast][at socket][fire point]
  12. …/…WHEN DO [play sound][sound: Weapon Artillery Fire]
  13. …/…WHEN DO [play sound][sound: Explosion Fire Small][volume][60][overlapping]
  14. …WHEN [countdown timer][0.5]
  15. …/…WHEN DO [switch page][page:@Cooldown]

Cooldown

  1. WHEN [page entered] DO [boolvar:fire cannon][equals][false]
  2. WHEN [countdown timer][1.5] DO [switch page][page: @Interacted – Shoot Cannon]

Project Spark Alphabet video

Comments are closed.

Powered by WordPress.com.

Up ↑

%d bloggers like this: