Click a Box to Kill other boxes
4 posts • Page 1 of 1
Click a Box to Kill other boxes
I tried with these codes, but it couldn't work well. How can I do with that?
The code on the box to click
The code on the box to be killed
The code on the box to click
- Code: Select all
OnClick=(e)=>{
scene.my.MoveRocket = true
}
The code on the box to be killed
- Code: Select all
PostStep=(e)=>{
timeToLive=(scene.my.MoveRocket)=0.1:+inf
}
- AN9K
- Posts: 5
- Joined: Tue Jun 30, 2015 12:14 am
Re: Click a Box to Kill other boxes
will not work even with correct syntax:
it will assign TTL = 0.1 every tick and live forever
so what you want to archive ?
- Code: Select all
PostStep=(e)=>{
timeToLive = scene.my.MoveRocket ? 0.1 : +inf
}
it will assign TTL = 0.1 every tick and live forever
so what you want to archive ?
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: Click a Box to Kill other boxes
timeToLive = scene.my.moveRocket? 0 : +inf
Orherwise use density instead of timeToLive, and a value like 2 or more where the +inf is at
Orherwise use density instead of timeToLive, and a value like 2 or more where the +inf is at
- The Linkage
- Posts: 57
- Joined: Fri Aug 05, 2011 5:40 pm
- Location: Escobar, Argentina
Re: Click a Box to Kill other boxes
This is how I would do it......
scene.my.moveRocket ? {TimeToLive = 0}:{TimeToLive = +inf }
Program flow makes more sense this way.
scene.my.moveRocket ? {TimeToLive = 0}:{TimeToLive = +inf }
Program flow makes more sense this way.
-
Xray - Posts: 500
- Joined: Sun Jun 17, 2012 6:12 am
- Location: USA
4 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 9 guests