SpawnMinerals (Harvest)

From OxeyeWiki

(Difference between revisions)
Jump to: navigation, search
(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
|
|
-
harvest.spawnMinerals(x, y, amount)
+
spawnMinerals(x, y, amount)
|
|
-
Creates a new mineral patch at the given position.
+
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|A number|The x coordinate for the mineral patch.}}
+
{{MethodParam|x|Number|The x coordinate for the mineral patch.}}
-
{{MethodParam|y|A number|The y coordinate for the mineral patch.}}
+
{{MethodParam|y|Number|The y coordinate for the mineral patch.}}
-
{{MethodParam|amount|An integer|The amount of minerals in the mineral patch.}}
+
{{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)
+
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.

Harvest Library

Example

harvest.spawnMinerals(0, 0, 100)
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox