how to use If .Then structures.
3 posts • Page 1 of 1
how to use If .Then structures.
I know thats a easy question,and Im already check the topic,but I didnt get the answer,
I made a timer,using onhitbylaser condition to count time, for example, onhitbylaser is scene.my.var1 = scene.my.var1 + 1.
thats clearly,but when the last condition , ?{ scene.my.var1 =5}:{scene.my.var1 =0},it didnt executed, algodoo automaticly transfer to (e)=>{?({scene.my.var1 = 5})(:)({scene.my.var1 = 0})} I dont know whats wrong with it.
thank u for helping me~
I made a timer,using onhitbylaser condition to count time, for example, onhitbylaser is scene.my.var1 = scene.my.var1 + 1.
thats clearly,but when the last condition , ?{ scene.my.var1 =5}:{scene.my.var1 =0},it didnt executed, algodoo automaticly transfer to (e)=>{?({scene.my.var1 = 5})(:)({scene.my.var1 = 0})} I dont know whats wrong with it.
thank u for helping me~
- epsilon
- Posts: 9
- Joined: Tue Dec 14, 2010 4:05 pm
Re: how to use If .Then structures.
if structure:
condition ? true action : false actions
examples:
scene.my.foo == 1 ? {scene.my.foo = 3} : {scene.my.foo = 2};
scene.my.counter = time > 1 ? 1 : 0;
http://www.phunland.com/wiki/Thyme
condition ? true action : false actions
examples:
scene.my.foo == 1 ? {scene.my.foo = 3} : {scene.my.foo = 2};
scene.my.counter = time > 1 ? 1 : 0;
http://www.phunland.com/wiki/Thyme
Dream of Algodoo as game development engine...
-

Kilinich - [Best bug reporter 2010]
- Posts: 2098
- Joined: Mon Aug 31, 2009 8:27 pm
- Location: South Russia
3 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 5 guests



