what's wrong ?
6 posts • Page 1 of 1
what's wrong ?
sorry for that little maybe stupid question but i tried out every possible way to write it down that i could imagine - it doesnt work right
code for onLaserHit
scene.my.v3 used for a display as shown text
problem: everytime it changes from zero to true ("immortal") but not to false ("mortal") (even if geom is not immortal)
i also tried to set another variable in front of the if function ,not directly the .e.geom.immortal.. nothing changed
what is the problem? is it because of the boolean value? no problems with integer values and "greater than's"
thanks for help
code for onLaserHit
- Code: Select all
(e)=>{e.geom.immortal = true ? {scene.my.v3 = "immortal"} : {scene.my.v3 = "mortal"}}
scene.my.v3 used for a display as shown text
problem: everytime it changes from zero to true ("immortal") but not to false ("mortal") (even if geom is not immortal)
i also tried to set another variable in front of the if function ,not directly the .e.geom.immortal.. nothing changed
what is the problem? is it because of the boolean value? no problems with integer values and "greater than's"
thanks for help
yup yup
yuuuuuuup
yupyupyupyupyupyupyupyupyyyuuuup
hm... signatures...
yuuuuuuup
yupyupyupyupyupyupyupyupyyyuuuup
hm... signatures...
- hiltropper
- Posts: 85
- Joined: Mon Dec 20, 2010 12:02 pm
- Location: Germany
Re: what's wrong ?
could you show me a example code for my special case with true/false? it works that way in other cases but not that one
that works
but
not.
thanks
- Code: Select all
(e)=>{e.geom.texture == "gold" ? {scene.my.v2 = "gold"} : {e.geom.texture == "ice" ? {scene.my.v2 = "eis"} : {scene.my.v2 = "undef."}}}
that works
but
- Code: Select all
(e)=>{e.geom.immortal == true ? {scene.my.v2 = "immortal"} : {scene.my.v2 = "mortal"}}
not.
thanks
yup yup
yuuuuuuup
yupyupyupyupyupyupyupyupyyyuuuup
hm... signatures...
yuuuuuuup
yupyupyupyupyupyupyupyupyyyuuuup
hm... signatures...
- hiltropper
- Posts: 85
- Joined: Mon Dec 20, 2010 12:02 pm
- Location: Germany
Re: what's wrong ?
e.geom.immortal == true is the same as e.geom.immortal
so in onLaserHit/onHitByLaser event code should work fine:
e.geom.immortal ? {} : {}
so in onLaserHit/onHitByLaser event code should work fine:
e.geom.immortal ? {} : {}
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
Re: what's wrong ?
I can't check this as im on a mobile device but
Notice that the word True, has the first character capitalised.
You can use killinich's method but i thought that i'd point out that the first character is capitalised.
- Code: Select all
(e)=>{e.geom.immortal == True ? {scene.my.v3 = "immortal"} : {scene.my.v3 = "mortal"}}
Notice that the word True, has the first character capitalised.
You can use killinich's method but i thought that i'd point out that the first character is capitalised.
When asking for help, READ THE STICKIES!
- electronicboy
- Posts: 1694
- Joined: Mon Aug 31, 2009 6:18 pm
Re: what's wrong ?
thank you ,everythings clear
now i know what was wrong sounds logic
now i know what was wrong sounds logic
yup yup
yuuuuuuup
yupyupyupyupyupyupyupyupyyyuuuup
hm... signatures...
yuuuuuuup
yupyupyupyupyupyupyupyupyyyuuuup
hm... signatures...
- hiltropper
- Posts: 85
- Joined: Mon Dec 20, 2010 12:02 pm
- Location: Germany
6 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 7 guests



