I want it so when I click on an object another object flashed for 1 second and then disappears. But i can only make it so it flashes every 1 second forever! Help! what do I do?
Printable View
I want it so when I click on an object another object flashed for 1 second and then disappears. But i can only make it so it flashes every 1 second forever! Help! what do I do?
I did it extremely different lol, that didn't work at all but w/e. thanks anyway
well, I meant that what I did worked, and what you suggested didn't work too well. haha, i guess we all him misunderstandings. But thanks for the help anyway!Quote:
Originally Posted by OldLongDragon
Other times, it's helpful to ignore posts that talk in obtuse riddles and get an actual answer instead.
What I usually do when I want a delay is to use an alterable value of the object I want to act upon, using it as a timer, like this:
When (clickable object is clicked on):
-> Flash object
-> Set object's alterable value A to 1
If object's alterable value A is greater than or equal to 1:
-> Add 1 to object's alterable value A
Object's alterable value A is greater than 50:
-> Destroy object
What this does is to continually add 1 to one of the object's alterable values if it's been set to 1 previously (it starts off at 0). This happens every time the game window is drawn, which happens 50 times per second by default - so the overall effect on the click is to start the flashing of the object and, one second later, to destroy the object.