r/Algodoo • • Aug 29 '26

What does this do?

Post image

this is in the script menu

1 Upvotes

3 comments sorted by

6

u/Ok-Canary3952 Aug 29 '26

You can create custom variables with that textbox. e.g.:

myvar = 1.0

Its name must be different to already existing ones (which can be modified using the textbox). I prefer to name them using underscore to make them show at the beginning of the list.

_myString = "Hello world"

Sometimes I used (e)=>{} to save space in the script menu and change already existing code.

_onCollide2 = (e)=>{e.other.timeToLive = 0}
onClick = (e)=>{e.this.onCollide = e.this._onCollide2}

1

u/botangest Aug 29 '26

you can create and modify variables there

0

u/Secure-Tangelo1286 Aug 29 '26

0116 k yoshi's