If it's not changing
5 posts • Page 1 of 1
If it's not changing
Hello I want to make a defensive canon that shoots down a nuke missile. The missile updates a variable called "scene.my.nukePos". When the missile gets shot down or explodes before the canon shoots it down it should stop update the "scene.my.nukePos".
Here's my problem: I want the canon to notice that the nuke is not moving ( wich means detonated or shot down ) and stop shooting and return to normal angle.
Simplified: How would I go around making a script that detects when a position isn't changing after 1 second?
Here's my problem: I want the canon to notice that the nuke is not moving ( wich means detonated or shot down ) and stop shooting and return to normal angle.
Simplified: How would I go around making a script that detects when a position isn't changing after 1 second?
make sure to check out my work.
-
Rideg - Posts: 948
- Joined: Tue Dec 15, 2009 5:17 pm
- Location: Östersund, Sweden
Re: If it's not changing
why don't just add scene.my.nukeActive = true variable and set it to false on explosion?
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: If it's not changing
Oh, didn't think of that thank you. But now I'm curious if there's a way to make a "if it's not changing" method.
make sure to check out my work.
-
Rideg - Posts: 948
- Joined: Tue Dec 15, 2009 5:17 pm
- Location: Östersund, Sweden
Re: If it's not changing
^^ 'Nuff said.
Otherwise:
Check the current value against a stored version of the last value, and have a conditional (if statement, if you must) to check if it is the same. If it is, set Scene.my.nukeActive to false, or do whatever.
Otherwise:
Check the current value against a stored version of the last value, and have a conditional (if statement, if you must) to check if it is the same. If it is, set Scene.my.nukeActive to false, or do whatever.
.. ,__,_____
. / __.==--" - - - - - - - - ""
./#(-'
.`-' From http://www.ascii-art.de/. Modded by me to work in Arial.
. / __.==--" - - - - - - - - ""
./#(-'
.`-' From http://www.ascii-art.de/. Modded by me to work in Arial.
a Mammoth wrote:be boring and interesting.
I didn't know you could go up 3.1.3! Thanks Mystery person!Mystery wrote:If you were jailbreaker you shouldn't have when't up the 3.1.3
-
Dakta - Posts: 417
- Joined: Sat Sep 12, 2009 4:36 pm
5 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 10 guests