-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathcreateField.lua
52 lines (42 loc) · 987 Bytes
/
createField.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
--
-- Created by IntelliJ IDEA.
-- User: nyovape1
-- Date: 11/23/2017
-- Time: 5:18 PM
-- To change this template use File | Settings | File Templates.
--
print( '<CPFields>\n<field fieldNum="1" numPoints="84">' )
local i, x, y = 1, -120, -100
for j = 1, 22 do
print( string.format( '<point%d pos="%d 0 %d"/>', i, x, y ))
i = i + 1
x = x + 10
end
for j = 1, 20 do
print( string.format( '<point%d pos="%d 0 %d"/>', i, x, y ))
i = i + 1
y = y + 10
end
for j = 1, 22 do
print( string.format( '<point%d pos="%d 0 %d"/>', i, x, y ))
i = i + 1
x = x - 10
end
for j = 1, 20 do
print( string.format( '<point%d pos="%d 0 %d"/>', i, x, y ))
i = i + 1
y = y - 10
end
i, x, y = 1, -20, -20
for j = 1, 41 do
x = -20
for k = 1, 41 do
if x < -10 or y < 5 or ( x > 0 and x < 10 and y < 15 ) then
print( string.format( '<islandNode%d pos="%d %d"/>', i, x, y ))
i = i + 1
end
x = x + 1
end
y = y + 1
end
print( '</field>\n</CPFields>' )