Is there a scene.my tutorial?

About advanced scenes, and the Thyme scripting language used in Algodoo.

Is there a scene.my tutorial?

Postby decepticon » Thu Feb 23, 2017 6:49 am

It'd be cool if there is. I've seen people make automatic creations, and even machines fighting each other, and sensors aswell, like if something goes in the sensor, an axle or spring is triggered.
decepticon
 
Posts: 21
Joined: Sat Dec 17, 2016 12:20 pm

Re: Is there a scene.my tutorial?

Postby Kilinich » Thu Feb 23, 2017 9:54 am

scene.my. is just a scope where you can define functions and variables (they saved with scene).

Code: Select all
scene.my.a := 1;
scene.my.f := (x) => {x +1};
scene.my.a = scene.my.f(a);
Dream of Algodoo as game development engine...
User avatar
Kilinich
[Best bug reporter 2010]
 
Posts: 2098
Joined: Mon Aug 31, 2009 8:27 pm
Location: South Russia

Re: Is there a scene.my tutorial?

Postby Xray » Wed Mar 01, 2017 6:10 am

@decepticon - What Kilinich said is correct, but I would add that "scene.my." variables and functions are defined in the Global scope, which means that any and all objects have direct access to them. So, for example, your code in a circle or box can directly read and write any scene.my variable. A variable defined in an object which includes a leading underscore character (such as _variable) will be saved as a "local" variable or function which can only be accessed by code within the same object (there are special exceptions to this that require special commands).

So, now you have all you need to know about scene.my! :thumbup:
User avatar
Xray
 
Posts: 500
Joined: Sun Jun 17, 2012 6:12 am
Location: USA

Re: Is there a scene.my tutorial?

Postby decepticon » Sat May 27, 2017 5:46 am

sorry for late reply, thanks xray!
decepticon
 
Posts: 21
Joined: Sat Dec 17, 2016 12:20 pm

Re: Is there a scene.my tutorial?

Postby Xray » Sat May 27, 2017 7:11 am

You are welcome. And of course if you have any specific questions, ask them here in the forum and someone will answer them.

Have phun! :)
User avatar
Xray
 
Posts: 500
Joined: Sun Jun 17, 2012 6:12 am
Location: USA


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 3 guests

cron