Login

Fancade Wiki

Updated Introduction to Editor Scripting.md (markdown)

... ...
@@ -61,7 +61,7 @@ setBlock(1, 0, 1, myBlocks[0]);
61 61
62 62
## Loops
63 63
Now if we want to place multiple blocks at once of course we will need a loop! JS uses 3 types of loop; "while" loop, "do while" loop and "for" loop. In this scenario we will use the "for" loop.
64
```
64
```js
65 65
const myBlocks = [findBlock("Bricks"), findBlock("Dirt")];
66 66
67 67
let x = 0;
... ...
@@ -75,7 +75,7 @@ for (let element of myBlocks) {
75 75
Objects `{}` works almost similarly to arrays but unlike it is not considered a collection of value but instead a single value composed of other values called "properties" and functions called "methods". Lets take for example a ball, you will ask, how bouncy is this ball? what is its radius? just like this ball an object has its own properties to determine its characteristics. Using it lets try to make a simple structure.
76 76
77 77
### Properties
78
```
78
```js
79 79
let justATree = {
80 80
x: 0,
81 81
y: 0,
... ...
@@ -94,7 +94,7 @@ properties are values that represent chracteristics of an object it can be any v
94 94
### Methods
95 95
methods are special properties of an object that can be used as instruction for its behaviors. Now lets try to add a new method named `build` inside `justATree`.
96 96
97
```
97
```js
98 98
let justATree = {
99 99
x: 0,
100 100
y: 0,
Fancade Wiki