SpawnMinerals (Harvest)
From OxeyeWiki
(Difference between revisions)
(Created page with '{{HarvestMethod | harvest.spawnMinerals(x, y, amount) | Creates a new mineral patch at the given position. | {{MethodParam|x|A number|The x coordinate for the mineral patch.}} {{...') |
|||
Line 1: | Line 1: | ||
{{HarvestMethod | {{HarvestMethod | ||
| | | | ||
- | + | spawnMinerals(x, y, amount) | |
| | | | ||
- | + | Adds a new mineral patch containing 'amount' minerals. The function will attempt to stack minerals if possible, which means it will look for minerals nearby (x, y) and add 'amount' to them instead of creating a new one. The mineral's graphics will be chosen depending on the amount. | |
| | | | ||
- | {{MethodParam|x| | + | {{MethodParam|x|Number|The x coordinate for the mineral patch.}} |
- | {{MethodParam|y| | + | {{MethodParam|y|Number|The y coordinate for the mineral patch.}} |
- | {{MethodParam|amount| | + | {{MethodParam|amount|Number|The amount of minerals in the mineral patch.}} |
| | | | ||
Returns nothing. | Returns nothing. | ||
Line 13: | Line 13: | ||
=== Example === | === Example === | ||
<pre> | <pre> | ||
- | + | harvest.spawnMinerals(0, 0, 100) | |
</pre> | </pre> |
Revision as of 22:50, 2 December 2009
spawnMinerals(x, y, amount) | ||
Adds a new mineral patch containing 'amount' minerals. The function will attempt to stack minerals if possible, which means it will look for minerals nearby (x, y) and add 'amount' to them instead of creating a new one. The mineral's graphics will be chosen depending on the amount. | ||
Parameter | Expected Type | Description |
x | Number | The x coordinate for the mineral patch. |
y | Number | The y coordinate for the mineral patch. |
amount | Number | The amount of minerals in the mineral patch. |
Returns | ||
Returns nothing. |
Example
harvest.spawnMinerals(0, 0, 100)