Shoot

From Wiki of ZZT
Revision as of 07:50, 10 February 2021 by RT-55J (talk | contribs) (Created page with "'''#shoot [direction]''' is a ZZT-OOP command to have an object shoot a bullet in a specified direction. It differs from <code>#put [dir] bullet</code> in that it cre...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

#shoot [direction] is a ZZT-OOP command to have an object shoot a bullet in a specified direction.

It differs from #put [dir] bullet in that it creates a moving bullet. Attempting to have an object shoot by using #put will result in the bullet colliding itself the same tick it was spawned. Moreover #shoot respects the solidity of walls, whereas #put would put a hole through the wall.

#shoot ends an object's code execution for the current tick, meaning that the soonest it can #change the bullet is when it is two tiles away.

Bullets shot by objects can trigger other objects' :shot labels, but cannot hurt built-in creatures.