Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Jrayp authored Apr 15, 2018
1 parent 6a012a4 commit 518b8ca
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,15 @@ local moku_ids = {

It is recommended to give your tile types simple descriptive names (keys). The value associated with the type is a reference to that types base tile position on the tile sheet. Here the `PLAINS` types base tile occupies position `1` on the tile sheet, the `PLATEAU` type position `49`, and the `OCEAN` type position `97`.

_**PROTIP:**_ It is possible to designate multiple Moku Ids using the same tile images as seperate auto-tiles, by using decimal values as such:

```lua
local moku_ids = {
PLAINS_1 = 1,
PLAINS_2 = 1.1,
}
```

Create a Moku map from your defold tilemap. Assuming your tilemap is named `my_tilemap` with layer named `layer1`, and is attached to the gameobject `map_go`:

```lua
Expand Down Expand Up @@ -189,18 +198,6 @@ Lets take a look at this functions parameters

So in our example, the `PLAINS` type will interact/join with everything except `OCEAN` tiles; and the `PLATEAU` type will interact with everything except `OCEAN` and `PLAINS` tiles.

_*PROTIP:*_ It is possible to designate multiple Moku Ids using the same tile images as seperate auto-tiles, by using decimal values as such:

```lua
local moku_ids = {
PLAINS_1 = 1,
PLAINS_2 = 1.1,
}

moku.set_autotile(my_new_map, moku_ids.PLAINS_1, moku.at_algorithm.COMPLEX, true, true, true)
moku.set_autotile(my_new_map, moku_ids.PLAINS_2, moku.at_algorithm.COMPLEX, true, false, false)
```

And now we can tell moku to tile the map:

```lua
Expand Down

0 comments on commit 518b8ca

Please sign in to comment.