more info on on-start

This commit is contained in:
Peli de Halleux
2017-01-19 17:51:48 -08:00
parent 51ebc29887
commit 28830aa905
2 changed files with 11 additions and 1 deletions

View File

@ -16,7 +16,13 @@ input.onButtonPressed(Button.A, () => {
led.setBrightness(50)
```
## What about JavaScript?
``on-start`` only exists in the block editor. In JavaScript, all code executes sequentially from the first line.
## Hey, my events moved!
When we transform the blocks into JavaScript, we always place all the event registrations (buttons, shake, ...)
before launching the ``on start`` code.
If a block from ``on start`` pauses, other registered events will have the opportunity to run as well.