About this manual
This manual explains ACTION GAME MAKER’s score drop feature.
How score drops work in ACTION GAME MAKER
Score drops handle the coins, experience orbs and similar pickups that scatter when you defeat an enemy or break a block. They carry the whole sequence — scattering and falling, bouncing, being drawn in as you approach, and increasing a variable when picked up — in one place.
If you built a coin out of an ordinary object, one coin would do as much per-frame work as one enemy. A score drop has a single node move and draw every instance together, so hundreds at once stay light. That node is created automatically the first time something drops, so there is nothing to place in the scene.
The settings for a kind of drop live in a resource called “ScoreDropData”. Adding kinds — gold coins, silver coins, experience orbs — costs nothing extra, because each kind is drawn together as a batch.
Note that score drops are not suited to coins placed on the map from the start. For anything placed statically, use a gimmick object.
How to spawn them
There are three ways to spawn score drops.
| Way | Where you set it |
|---|---|
| Visual script | The action “GenerateScoreDrop”. Put it on an enemy’s defeat action, for example |
| Gimmick object | “Destroy Score Drop” and the destroy score drop count. Lets a broken block produce coins |
| Barrage bullets | “Score drop” and the score drop count in the bullet’s drop data. Spawns them where the bullet hit |
In every case, all you specify is the “ScoreDropData” resource and a count. Setting the count to 0 uses the count configured on the resource.
“GenerateScoreDrop”
It is in the “Object Control” category under “Add Other Action”.
- Score drop: the kind to spawn (a ScoreDropData resource). How they scatter, how long they last and what happens on pickup are all decided by this resource.
- Count: how many to spawn. 0 uses the resource’s count.
- Spawn Offset: how far from the object’s position to spawn them (in px).
- Spawn Probability: the chance of spawning (0 to 100 percent).
ScoreDropData
The settings for one kind. You can create a new one from the “Score drop” field. Name it and save it, and other actions and gimmicks can point at the same one.
Image
- Texture: the sheet image to display.
- Horizontal Frame / Vertical Frame: how many cells to divide the sheet image into.
- Is Animation: turn it on and it loops from the start frame to the end frame. Use it for spinning coins and the like.
- Start Frame Index / End Frame Index / Frame Interval: which frames to show and how fast to switch between them.
- Z Index: the draw order. A higher value draws in front. If the drops are hidden behind grass or similar, set it higher than that. Because each kind is drawn together as a batch, setting this costs nothing extra.
Scattering
- Spawn Count: how many appear at once. The spawning side can override it.
- Spawn Count Random (±): the variation in the count. With 5 and a variation of 2 you get 3 to 7.
- Move Angle: the base direction before scattering. The default is upward, so they fly up and then fall.
- Scatter Angle: how far the angle varies from the base direction (in degrees). Larger spreads them wider.
- Move Speed / the random range on it: how fast they fly out, and its variation. A little variation stops them all landing at the same moment.
- Move Damping: how quickly the momentum drops off. Larger settles them sooner.
Falling
- View Mode: choose from “Auto (follow the project setting)”, “side view” or “top view”. In a side view they fall downward and land on floor tiles. In a top view the vertical axis of the screen is depth along the ground, so instead they are given a height, bounce up, and come back down to the ground where they were thrown (they do not cross walls).
- Gravity Enabled: turn it off and they do not fall — they drift where they were thrown.
- Gravity influence: how strongly they are pulled downward.
- Jump Speed / bounce variation (±): how hard they bounce up in a top view.
- Bounce Enabled / Bounce Damping / Bounce Count Max: the bounce on landing. 0.5 halves the momentum on each bounce. On a slope they bounce along the slope.
Shadow
Settings used only in a top view.
- Shadow Enabled: draws a shadow under each instance. The shadow shrinks and fades with height, which lets the player read how high something is.
- Shadow image / shadow size (px) / shadow colour: leave the image empty and a blurred ellipse is used.
Disappearing
- Lifetime: how long an instance that is never picked up stays before disappearing. It stops abandoned drops piling up.
- Lifetime variation (± seconds): the variation that stops them all disappearing at once.
- Blink Before Vanish: how long they blink before disappearing, to signal that they are about to go. 0 means no blinking.
Value
- Value Min / Value Max: the value of one instance. Each instance picks from this range, so a single kind can mix high and low values.
Who can pick them up
- Pickup Target Type: choose “specify by object group” or “specify by object”.
- Target group: the object group that picks them up. The default is the player’s group.
- Pickup object: point at an object when you want something other than the player to pick them up.
Picking up
- Pickup Delay: the wait between spawning and becoming pickable. Set it when you want them picked up only after they land. They are not drawn in during the wait. 0 makes them pickable the instant they appear.
- Pickup Radius: get this close and it is picked up.
- Attract Radius: get this close and the drop starts being drawn in. 0 means no attraction.
- Attract Radius Variable: takes the attraction distance from a variable. Choose where it lives (project variable / a specified object / an object on the shared board) and the variable name. That lets a magnet item widen the attraction range only while it is active.
- Attract Speed / Attract Acceleration: the top speed and acceleration while being drawn in. Too much speed makes drops overshoot and orbit the target, so lower it if they will not get picked up.
What happens on pickup
- Variable Target: where the variable that the value is added to lives. Choose “common” (project-wide) or “the object that picked it up”.
- Sample object for choosing the variable: with “the object that picked it up”, this is the sample used to list variable names. The value actually changes on whoever picked it up.
- Variable name: the variable the value is added to — a coin count, say. Everything picked up in the same instant is added in one go, so picking up 100 at once costs the same as one.
- Sound data: the sound played on pickup. The number playing in the same instant is capped, so picking up a lot does not distort the audio.
- Particle / effect / display time (seconds): the presentation shown where the drop was picked up. Choose one-shot particles (looping ones keep going on the spot).
Worked examples
Coins dropped by enemies
- Create a ScoreDropData, point the image at a coin sheet and turn on Is Animation.
- Leave the scattering at its defaults (fly up and fall), and set the spawn count to 3 with a variation of 1.
- Under what happens on pickup, set the variable target to “common” and the variable name to your coin count variable.
- Put “GenerateScoreDrop” on the enemy’s defeat action and point it at the resource you made.
Experience orbs (that get drawn in)
- Turn Gravity Enabled off so they drift where they were thrown.
- Set a generous Attract Radius (128, for example) so they gather as you approach.
- Give Value Min and Value Max a range and one kind can scatter varying amounts of experience.
- Set the variable target to “the object that picked it up” and only that character’s experience goes up.
Coins from a block
- Point the gimmick object’s “Destroy Score Drop” at your resource and enter a count.
- If the block is broken by standing on it, adding a little Pickup Delay makes them easier to follow, since they are picked up after they land.
A magnet item
- Point Attract Radius Variable at a common variable (an “attract range” variable, for example).
- Increase that variable when the item is taken, and put it back when the effect ends.
- A variable of 0 means no attraction.
Things to watch out for
- Score drops are not saved. Drops lying on the ground are not preserved, so put any reward you want kept into a variable before saving.
- They cannot be used for coins placed on a map in advance (they only spawn at runtime). Use a gimmick object for anything placed statically.
- The pickup sound and particles are capped in number and spacing so that picking up a lot does not produce too many. They do not fire for every single instance.
- Too much Attract Speed makes drops fly past before they get within the pickup radius. If they will not get picked up, look at the speed first.
- The shadow and the jump speed are used only in a top view. They are not shown in a side view.
- Specifying a looping particle for the pickup presentation leaves it running on the spot. Use a one-shot particle.