Updated Introduction to Editor Scripting.md (markdown)
commited
commit
952f0571b6729fb728e961a4ee548ef95db325ca
... | ... | @@ -108,12 +108,12 @@ let justATree = { |
108 | 108 | build: () => { |
109 | 109 | for (let c in this.components) { |
110 | 110 | for (let i = 0; i < (c[1][0] * c[1][1] * c[1][2]); i++) { |
111 | let x = c[2][0] + |
|
112 | let y = c[2][1] + |
|
113 | let z = c[2][2] + |
|
111 | let x = c[2][0] + (i % c[1][0]);
|
|
112 | let y = c[2][1] + (i % c[1][1]);
|
|
113 | let z = c[2][2] + (i % c[1][2]);
|
|
114 | 114 | // the "this" keyword refers to the object it is inside to, |
115 | 115 | // we use "this" when the object is not or not yet defined by a variable |
116 | setBlock(this.x + x, this.y + y, this.z + z, 0); |
|
116 | setBlock(this.x + x, this.y + y, this.z + z, c[0]); |
|
117 | 117 | } |
118 | 118 | } |
119 | 119 | } |