Voxel Game Maker

Docs Cookbook

Shooter

Place a turret. What is it? ▸ Enemy, Type Shooter (or the Turret role on the Character card).

#Without code

  1. Place a turret. What is it? ▸ Enemy, Type Shooter (or the Turret role on the Character card).
  2. In Advanced, Shooter: its Range (tiles), Seconds between and Projectile model.
  3. Select the projectile model (Explorer ▸ Models) and give it Damage (Hurts player) and Destroy (When it hits any, Then vanish or explode).
  4. Optional: Only while switch is on so a lever turns it off.

#Quick code

Where it goes: on the turret, Event: Player enters the world.

there is no one-line "fire" function; the simplest code version changes the Shooter's settings.

on_health(50, function()
  self.set_behavior("shooter", "interval", 0.5)  -- fires faster when hurt
end)