Appear briefly then Disappear

Game Editor comments and discussion.

Appear briefly then Disappear

Postby trajecto » Sat Jun 10, 2006 3:09 am

How can I make something appear briefly then disappear?

For example: My character collides with a pickup, his score goes up, the pickup disappears, a text point value actor appears, then after a pause, disappears. Standard stuff.

Thanks!
User avatar
trajecto
 
Posts: 86
Joined: Fri Jan 16, 2004 3:12 pm
Location: Michigan, US
Score: 6 Give a positive score

Postby Just4Fun » Sat Jun 10, 2006 4:45 am

Hi trajecto:

I may be off base here, but I would really like to be able to help you so I thought I would give a try in answering your question. If you use a drawActor --> script editor script like:

transp += 0.015;
if (transp >=1)
transp = 0;

This will cause the actor to fade out and then 'blink' back and reappear.

HTHs :wink:
I've learned that I still have a lot to learn.

** Makslane == Genious **
Just4Fun
 
Posts: 524
Joined: Tue Jul 01, 2003 5:19 am
Location: USA: Washington State; West Coast
Score: 6 Give a positive score

Postby trajecto » Sat Jun 10, 2006 5:01 am

Hi there Just4Fun, thank you so much! I tried it, looks good!

Now if it just wouldn't repeat after it diminishes... how to?
User avatar
trajecto
 
Posts: 86
Joined: Fri Jan 16, 2004 3:12 pm
Location: Michigan, US
Score: 6 Give a positive score

Postby makslane » Sat Jun 10, 2006 5:27 am

You can use a timer
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby trajecto » Sat Jun 10, 2006 5:30 am

Thanks Makslane, I got it to work though with:

transp += 0.015;
if (transp >=1)
DestroyActor("Event Actor");



Curious though, how could I use a timer?
User avatar
trajecto
 
Posts: 86
Joined: Fri Jan 16, 2004 3:12 pm
Location: Michigan, US
Score: 6 Give a positive score

Postby makslane » Sat Jun 10, 2006 6:01 am

My character collides with a pickup, his score goes up, the pickup disappears, a text point value actor appears, then after a pause, disappears. Standard stuff.

When the character collides with a pickup, create a timer, make character invisible, create the text point (with a timer to destroy), and, in the timer event of character, make it visible again.
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby Just4Fun » Sat Jun 10, 2006 6:10 am

trajecto:

Now if it just wouldn't repeat after it diminishes... how to?


Another way to control the fade looping besides using the DestroyActor function or a timer is to place the myActor.transp = 0; script in another actor's event. For example, maybe you could place the script in your actor that is collided with. I tried it with two actors: one with a DrawActor event and one with a MouseDown event. It worked just fine.

I suppose this is all just extra non-essential verbage since you already have the code working, but I find the number of ways to do a thing in GE interesting.

And trajecto, thanks again for all that you contribute to us. I've learned a lot from you. Image
I've learned that I still have a lot to learn.

** Makslane == Genious **
Just4Fun
 
Posts: 524
Joined: Tue Jul 01, 2003 5:19 am
Location: USA: Washington State; West Coast
Score: 6 Give a positive score

Postby trajecto » Sat Jun 10, 2006 1:24 pm

You are welcome Just4Fun,

I have fun writing the tutorials and will keep them coming!
User avatar
trajecto
 
Posts: 86
Joined: Fri Jan 16, 2004 3:12 pm
Location: Michigan, US
Score: 6 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest