Click or drag to resize
SpriteBaseTileTake Method
Determine if the sprite is touching the specified tile, and if so, "take" it and increment a counter (requires TouchTiles(TileCategoryName)).

Namespace: (Default Namespace)
Assembly: Default (in Default.exe) Version: 1.0.0.0
Syntax
C#
public virtual int TileTake(
	int TileValue,
	Counter Counter,
	int NewValue
)

Parameters

TileValue
Type: SystemInt32
Index of the tile to look for.
Counter
Type: (Default Namespace)Counter
Counter to be checked and incremented when the specified tile is found. If the counter's maximum value has been reached, the tile will not be taken.
NewValue
Type: SystemInt32
Specified the tile value with which the touched tile will be replaced if the counter has not hit its maximum.

Return Value

Type: Int32
The number of tiles affected.
Remarks

This function will search through all tiles that have been touched (collected by TouchTiles(TileCategoryName), and for each tile that it finds that matches the specified TileValue, it will check Counter, and, if it has not yet reached the maximum value, increment the counter and replace the tile with the tile number specified by NewValue.

Only unprocessed tiles are considered. Once this function (or similar functions) affects the tile, it is marked as processed. It is only marked as processed if it is affected (if the counter changes).

See Also