equal
deleted
inserted
replaced
7 Simple examples are given below. Note that drawn maps use an area of 4096×2048. The examples below are static, but obviously this could be used for a random map variation—for example, simulating the Cave map by doing the fill below, then drawing random tunnels using circles that shift their course smoothly. |
7 Simple examples are given below. Note that drawn maps use an area of 4096×2048. The examples below are static, but obviously this could be used for a random map variation—for example, simulating the Cave map by doing the fill below, then drawing random tunnels using circles that shift their course smoothly. |
8 |
8 |
9 == Preconditions == |
9 == Preconditions == |
10 First of all, you must make sure that the global variable `MapGen` is set to `mgDrawn`. This is done in `onGameInit`. |
10 First of all, you must make sure that the global variable `MapGen` is set to `mgDrawn`. This is done in `onGameInit`. |
11 |
11 |
12 To draw maps, you only need 2 functions: `AddPoint` and `FlushPoints`. See LuaAPI for the explanation. |
12 To draw maps, you only need 2 functions: `AddPoint` and `FlushPoints`. See [LuaAPI] for the explanation. |
13 |
13 |
14 You also should not forget to make use of `onPreviewInit` so the map preview is displayed correctly. |
14 You also should not forget to make use of `onPreviewInit` so the map preview is displayed correctly. |
15 |
15 |
16 == Cave == |
16 == Cave == |
17 This generates a simple cave map: |
17 This generates a simple cave map: |