1 registered members (AbrahamR),
717
guests, and 4
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
A fade effect - [SOLVED]
#426132
07/17/13 02:59
07/17/13 02:59
|
Joined: Jul 2013
Posts: 66 Don't have a one...
DonaldThief
OP
Junior Member
|
OP
Junior Member
Joined: Jul 2013
Posts: 66
Don't have a one...
|
Hi, guys
I read some AUMs and everything worked fine until I came to the section talking about fade effect (actually, I couldn't understand anything). So, I'd like anyone to share his knowledge and tell me how to make fading in & out effect
Also, if any of you guys know some tutorial for particles (fire, explosion, smoke ...etc.) it will be better if he/she shares it
Thank you for reading
Last edited by DonaldThief; 07/17/13 14:16.
|
|
|
Re: A fade effect
[Re: DonaldThief]
#426134
07/17/13 05:14
07/17/13 05:14
|
Joined: Feb 2010
Posts: 886
Random
User
|
User
Joined: Feb 2010
Posts: 886
|
Easy fade script from the manual.
set(my,TRANSLUCENT);for (my.alpha=0; my.alpha+=5*time_step; my.alpha<100) wait(1);
reset(my,TRANSLUCENT);
The manual is a great place to look ^^
|
|
|
Re: A fade effect
[Re: DonaldThief]
#426137
07/17/13 05:56
07/17/13 05:56
|
Joined: Oct 2002
Posts: 2,256 Oz
Locoweed
Expert
|
Expert
Joined: Oct 2002
Posts: 2,256
Oz
|
BMAP* bmpSpark = "spark.bmp";
function effectBloodSplatFade(PARTICLE* p) { p.size -= (.25+random(.25)) * time_step; // reduce blood splats size with some randomness p.alpha-=4*time_step; // fade out bloodsplat p.lifespan = maxv(0,p.alpha); // when alpha reaches <= 0, lifespan = 0, thus ending that particular bloodsplat particle }
function effectBloodSplat(PARTICLE* p) { vec_set(p.vel_x,vector((random(2)-1),(random(2)-1),(.5-random(1)))); // give a little random velocity to each bloodsplat particle
//give a little random start position to each bloodsplat p.x += random(3)-1.5; p.y += random(3)-1.5; p.z += random(3)-1.5; p.bmap = bmpSpark; set(p,STREAK|BRIGHT|MOVE); // set particle parameters p.size=4+random(8); // give each bloodsplat a little random size p.alpha = 70 + random(15); // give each bloodsplat a little random alpha(visiblilty) p.gravity = 0.3; // make particles fall down with gravity, not necessary for some effects
//give each bloodsplat a little random red color p.red = 200 + random(55); p.green= 20 + random(10); p.blue = 20 + random(10);
p.event = effectBloodSplatFade; // call the fade event }
// Somewhere in code that calls effect ... effect_local(effectBloodSplat,(2+random(4)),my.x,nullvector); // create 2 to 6 blood splats at entity position ...
About as simple as it gets, except for the randomness stuff, That's all I got for you, hope it helps, Later, Loco
Professional A8.30 Spoils of War - East Coast Games
|
|
|
Re: A fade effect
[Re: rayp]
#426173
07/17/13 14:07
07/17/13 14:07
|
Joined: Jan 2002
Posts: 4,225 Germany / Essen
Uhrwerk
Expert
|
Expert
Joined: Jan 2002
Posts: 4,225
Germany / Essen
|
white_pan.scale_x = screen_size.x
I guess this is not your intention. You meant
white_pan.size_x = screen_size.x
right?
Always learn from history, to be sure you make the same mistakes again...
|
|
|
Re: A fade effect
[Re: DonaldThief]
#426274
07/19/13 03:05
07/19/13 03:05
|
Joined: Oct 2002
Posts: 2,256 Oz
Locoweed
Expert
|
Expert
Joined: Oct 2002
Posts: 2,256
Oz
|
Ah, whole screen, glad you got it figured out.
Later, Loco
Professional A8.30 Spoils of War - East Coast Games
|
|
|
|