About This Manual
This manual explains the Gimmick Object (GimmickObject2D) in ACTION GAME MAKER.
Overview of Gimmick Objects in ACTION GAME MAKER
Gimmick Objects are lightweight nodes designed for “traps placed in large numbers on the map,” such as breakable blocks, coins, and spikes. Unlike normal objects, they do not perform per-frame processing; they only activate when triggered by events like contact, attacks, or chain reactions. This means that placing hundreds of them will not cause performance issues.
However, they do not support visual scripts. All behaviors are configured via fixed menus in the Inspector. Since they do not move on their own, create moving traps using normal objects.
The capabilities are broadly as follows:
- Has durability (HP) and breaks when damaged by contact or attacks.
- Plays sounds, animations, shakes, particles, and effects when broken.
- Spawns items, swaps with another object, or drops score items when broken.
- Changes variables or switches when broken.
- Deals damage to objects that touch it (e.g., spikes, lava).
- Overwrites the Area Variables of touching objects (functions similarly to tiles with Area Variables set).
- Propagates destruction to adjacent gimmicks (chain reactions).
- Becomes an impassable wall (can be stood on, like tiles).
Placement
Placing Directly on the Map
- Open the map in the Map Creation View.
- Select “Gimmick Object” from the Add menu in the “Map Layers” dock.
- Adjust the shape and size of the automatically generated CollisionShape2D, then configure the image and behavior in the Inspector.
Creating from Templates
When placing many of the same gimmick, creating them as objects allows for reuse.
- Open “New” in the Object Creation View.
- If the Object Group is set to “Item” or “Platform,” a list of gimmick templates and empty gimmick objects will appear.
- Select a template to create it, and modify the image or settings as needed.
- Place the created object onto the map.
The available templates are the following five types:
| Template | Description |
|---|---|
| Coin (Gimmick) | A lightweight coin that disappears upon contact. Can be placed in large numbers on the map. |
| Breakable Barrel | A barrel that breaks when attacked, scattering particles. |
| Chain Block | A block where destruction propagates to surrounding blocks. |
| Chain Bomb | A bomb that explodes and triggers chain reactions in surrounding gimmicks. |
| Spike (Gimmick) | A spike that deals damage in all directions upon contact. |
Image Settings
The appearance of gimmicks is created from sprite sheets (single images containing multiple frames). You can combine idle, hit, and break animations into a single image.
- Texture: The sprite sheet to display.
- Columns / Rows: Specifies how many frames the sprite sheet is divided into.
- Enable Animation: When turned on, it loops from the start frame to the end frame.
- Start Frame / End Frame: Frames used for the idle appearance. If animation is not used, the start frame is displayed as a static image.
- Frame Interval (seconds): The duration for displaying one frame.
Since the idle animation is driven by a shader, adding more instances does not increase processing load. However, all instances move in sync. You can select frames while viewing the sprite sheet using the buttons at the top of the Inspector.
Basic Settings
- HP: Durability. It decreases with each hit, and when it reaches 0, the break behavior triggers. Set this to 1 for items that disappear in one hit, like coins.
- Return to Original State After Breaking: “Reset on Scene Reload” returns the object to its original state every time the map is reloaded (suitable for blocks). “Do Not Return” leaves it broken, and this state is saved in the save data (suitable for coins or items you want to keep taken).
- Object Group: The group this gimmick belongs to. If the attacking side targets a specific group, this gimmick must belong to that group to be affected.
- Make Impassable: When turned on, it acts as an impassable wall like a tile. It can be stood on or block progress. The collision shape is automatically generated from the wall, so no additional nodes are needed.
- Collision Extension Width (px): The width by which the detection range extends outside the wall. Since attacks stop slightly before overlapping the wall, extending the detection range prevents missed hit detections. The actual size of the wall does not change.
Triggers for Taking Damage
On Contact
- Take Damage on Contact: When turned on, it takes damage upon being touched. Use this for items that disappear instantly upon contact, like coins.
- Damage per Contact: The HP reduced by a single contact. Set to 0 to play the effect without breaking.
- Limit Responding Targets by Group / Responding Object Group: Restricts the gimmick to react only to objects belonging to a specific group.
- Responding Contact Direction: Choose from “Up”, “Down”, “Left”, “Right”. “Up” means the other object is above (stepped on), “Down” means hit from below. If nothing is selected, it reacts to all directions.
On Attack
- Take Damage from Attacks: When turned on, it takes damage from attacks. There is no need to add a separate collision node for receiving attacks.
- Damage Calculation Method: “Fixed Value” always uses the same value. “Attacker’s Attack Power” uses the attack power of the attacking object.
- Damage per Attack: The HP reduced when using “Fixed Value”. Set to 0 to play the effect without breaking.
- Limit Responding Attacks by Group / Responding Attack Source Object Group: Enables attacks only from specific groups.
Conditions for Taking Damage
You can configure the gimmick to take damage only when variables or switches have specified values. Use this for blocks that cannot be broken until powered up. If conditions are not met, it plays the sound for taking no damage.
- Take Damage Only When Conditions Are Met: Enables or disables this feature.
- Reference Type: Choose “Variable” or “Switch”.
- Reference Target: Choose from “Global” (entire project), “Specific Object”, or “Touching Object”.
- Variable/Switch Name: The name to look up. Leave empty for no condition.
- Variable Value for Damage / Switch Value for Damage: Damage is taken only if the value matches this.
Dealing Damage to Touching Objects
This setting allows the gimmick to damage objects that touch it, similar to spikes or lava. Damage is applied to the target’s collision shape, so objects with disabled collision shapes will not take damage.
- Deal Damage to Touching Objects: Enables or disables this feature.
- Min Attack Power / Max Attack Power: The base attack power for the damage dealt. Setting them to the same value results in fixed damage.
- Damage Attribute: Compared against the target’s damage resistance settings. Targets that negate this attribute will not take damage.
- Re-attack Interval (seconds): The time before dealing damage again to an object that remains in contact. Set to 0 to deal damage only once, and not again until the object leaves and re-enters contact. If the target is invincible, damage is not applied, so the actual interval is the longer of this time or the invincibility duration.
- Limit Targets by Group / Object Group for Damage: Restricts damage to specific groups.
- Contact Direction for Damage: Selecting “Up” makes it safe from the sides, piercing only when stepped on.
- Damage Calculation: You can set the damage calculation method (LEGACY / CUSTOM), formula, rounding, and minimum damage. In CUSTOM mode, you can use the same syntax as the “Attack Settings” action, but since gimmicks do not have their own variables, attacker variables (starting with
a.) will be empty. - Display on Damage: You can configure sounds, particles, effects, and their display duration. These will not play if the target is invincible and takes no damage.
Knockback is not handled by the gimmick. To knock enemies back, use the “Knockback Self” action in the target’s visual script.
Overwriting Area Variables of Touching Objects
This setting performs the same function as the “Area Variable” in tile settings, but for gimmicks. While touching the gimmick, the target’s area variable is overwritten with the gimmick’s value. Unlike tiles, gimmicks can be broken and removed, allowing for areas that can be cleared later, such as “grass that reveals hiding spots when cut” or “water areas that disappear when chained blocks collapse.”
- Enable Area Variables: Enables or disables this feature.
- Area Variable Value: The value to set in the touching target’s area variable.
- Object Group for Overwriting Area Variables: Only overwrites targets belonging to a specific group. If nothing is selected, all touching objects are affected (opposite to tile settings, where selecting nothing means it affects no one).
The value is determined as follows:
- When leaving or if the gimmick breaks, the value reverts to the tile underneath (or -1 if none). If “Leave Last Frame” is enabled to keep the broken appearance, the effect ceases at the moment of breaking.
- If touching a tile with an area variable set, the gimmick’s value takes precedence.
- If touching multiple gimmicks with different values simultaneously, the value of the last gimmick touched is used.
This feature only works on objects that receive tile effects (i.e., “Receives Tile Effects” is turned on). It applies to normal objects with body collision shapes, not to area-type objects.
Chain Reactions
- Chain: When turned on, it participates in chain reactions. It breaks when receiving a signal from an adjacent gimmick and sends a signal to neighbors when it breaks. This allows for walls that collapse sequentially from the placement point.
- Delay Until Propagation to Neighbor (seconds): Increasing this value slows down the collapse progression.
- Propagate Diagonally: When off, propagation is limited to up, down, left, and right.
- Chain Reach Distance (px): The distance considered “adjacent.” Setting this slightly larger than the gap between placed blocks allows propagation to gimmicks of different sizes. If too large, it may jump across gaps.
If both contact and attack triggers are turned off, the gimmick cannot be broken directly and only collapses when a chain reaction reaches it.
Effects
Effects on Taking Damage
- Hit Sound / No-Damage Sound: You can separate sounds for when damage is taken versus when conditions are not met (no damage). Use this for the “clink” sound of indestructible blocks.
- Hit Animation: Plays a single animation using the same sprite sheet frames (Start Frame, End Frame, Frame Interval).
- Hit Shake: Specifies the shake amplitude (px) and duration (seconds).
- Hit Display: Specifies particles, effects, and display duration.
Effects on Breaking
- Break Sound: The sound played when broken.
- Break Animation: Plays a single animation using the same sprite sheet frames. When “Leave Last Frame” is turned on, it remains on screen instead of disappearing (the wall and collision remain, but it no longer reacts). Use this for used blocks after being hit.
- Break Shake / Break Fade Out: Allows for effects like shaking before disappearing or fading out gradually.
- Break Display: Specifies particles, effects, and display duration. Choose one-shot particles for breaking (looping particles will continue playing on the spot).
Results of Breaking
- Object Generated on Break: The object that appears at the break location. Use this for items dropped from blocks.
- Score Drop on Break / Number of Score Drops on Break: Scatters coins or experience orbs at the break location. Since these are not individual objects, performance is not impacted even if many are spawned. Setting the count to 0 uses the count configured in the score drop settings.
- Object Swapped on Break: The object placed in place of the broken gimmick. Specifying another gimmick creates a block that changes appearance each time it is hit.
- Variable on Break / Switch on Break: Changes variables or switches when broken. Reference targets can be “Global”, “Specific Object”, or “Touching Object”. For variables, you can choose “Increment/Decrement” or “Assign”, but assignment is only allowed for variables held by objects. This can be used to count coin pickups or set door flags.
Practical Examples
Coin
- HP = 1, Take Damage on Contact = On, Damage per Contact = 1
- Return to Original State After Breaking = Do Not Return (keep taken)
- Make Impassable = Off
- Configure Break Sound and Break Variable (Increment global variable “Coin” by 1)
Block Breakable by Attack that Drops Items
- HP = 1, Take Damage from Attacks = On, Make Impassable = On
- Specify item in “Object Generated on Break”
- Use Break Animation and Break Particles to show the breaking moment
- Return to Original State After Breaking = Reset on Scene Reload
Floor that Breaks When Stepped On
- Take Damage on Contact = On, Responding Contact Direction = Up
- Make Impassable = On
- Configure Break Shake and Fade Out to create a floor that collapses after being stepped on.
Spikes that Hurt When Stepped On
- Deal Damage to Touching Objects = On, Set Min/Max Attack Power
- Contact Direction for Damage = Up (safe from sides)
- Adjust interval for continuous contact using Re-attack Interval (seconds)
Cuttable Grass (Allows Hiding)
- Enable Area Variables = On, Area Variable Value = 1 (configured so enemies “do not detect player when player’s area variable is 1”)
- Make Impassable = Off, Take Damage from Attacks = On
- Cutting it with an attack removes the hiding spot. If the Object Group for Overwriting Area Variables is set to the Player group, the value does not change when enemies enter.
Wall that Collapses from the Edge
- Chain = On, Set Chain Reach Distance slightly larger than block spacing
- Enable “Take Damage from Attacks” on only one block (the starting point), and turn it off for others.
- Adjust collapse speed using Delay Until Propagation to Neighbor (seconds).
Notes
- Gimmick Objects do not support visual scripts and do not move on their own. For moving traps or complex conditional branching, use normal objects.
- The child CollisionShape2D is used for walls, detection, and damage ranges. Therefore, you cannot separate the wall from the dangerous area (e.g., “only the tip of the spike is dangerous”). Express this instead using direction settings.
- If attacks are not connecting, check if the Gimmick’s Object Group matches the group targeted by the attacker. The Collision Extension Width (px) also affects missed detections.
- Variable names and switch names specified in Gimmick settings are not subject to search or batch renaming in the “Reference Locations” search or name lists of the Variable/Switch Settings window. If you change names, you must manually update the Gimmick settings as well.
- The Object Group for Overwriting Area Variables is determined by the group at the moment of contact. Even if the target’s group changes while touching, the effect does not toggle on or off.
- Idle animations move all instances in sync. To stagger them, prepare separate gimmicks with different frame intervals.
- Gimmicks set to “Do Not Return” save their broken state in the save data. Do not use this for items you want players to be able to re-collect.