Adds, removes or modifies a hit zone for an image
which reacts to shots/attacks
Each hit zone will trigger the hitzone
-hook when it is hit by a shot/attack.
Available modes are:
Non-Blocking Modes (<=100, shots will pass through)
Blocking Modes (>100, shots will get stopped)
- 0 - no hit zone (this removes existing hit zones, other parameters don't matter)
- 1 - hit zone without effects (just register)
- 2 - wall effect
- 3 - blood effect
- 4 - green blood effect
- 101 - hit zone without effects + stop shot
- 102 - wall effect + stop shot
- 103 - blood effect + stop shot
- 104 - green blood effect + stop shot
All hit zones with modes which are higher than 100 will block the shots (objects behind them will not be damaged). They basically behave like walls but they have no influence on player movement or vision.
Images are normally centered. So a hit zone for a 100x100 pixel image
should have the values:
So x-offset is commonly -width/2 and y-offset -height/2
can have only one hit zone. If you call imagehitzone
multiple times on the same image
, the existing hit zone will be modified!
You can call imagehitzone
with mode 0 on an image which already has a hit zone to remove the hit zone completely.
Attention: The hit zone is always rectangular without rotation. Image rotation does NOT affect the hit zone in any way.
Attention: Defining a big number of hit zones can have a bad impact on the game performance (when shooting)!
Hit zones do not work with images
which are drawn as HUD (image mode 2)!
Attention: Very thin hit zones might not react properly to all shots. A minimum width/height of 10 pixels is recommended!