The Dink Network

growing sprites from small

April 22nd 2003, 07:50 PM
pq_frog.gif
Ric
Peasant They/Them Canada
 
I want to spawn a sprite from small (5%) , then grow it large. But it disapears when it reaches its size.
int &felmx = sp_x(&current_sprite,-1);
int &felmy = sp_y(&current_sprite,-1);
int &felm = create_sprite(&felmx,&felmy,6,971,1);
sp_size(&felm,5);
sp_brain_parm(&felm, 400);
sp_brain(&felm, 12);
wait(3000);
sp_brain(&felm,6);
sp_speed(&felm,1);
sp_target(&felm,1);
sp_base_walk(&felm,970);
April 22nd 2003, 08:52 PM
burntree.gif
Striker
Noble She/Her United States
Daniel, there are clowns. 
That's because the shrink/grow brain kills the sprite one it reaches the size you set it to.

If you want something to grow to a size and keep it that way, you have to "fake it", like this:

sp_size(&felm, 5);
wait(50);
sp_size(&felm, 20);
wait(50);
sp_size(&felm, 40);
wait(50);
sp_size(&felm, 60);
wait(50);
sp_size(&felm, 80);
wait(50);

... you get the idea. Tweak it for speed how smoothly you want it to grow.
April 22nd 2003, 11:57 PM
wizardg.gif
Paul
Peasant He/Him United States
 
Or to make it a bit smoother, use a loop like so:
int &felmx = sp_x(&current_sprite,-1);
int &felmy = sp_y(&current_sprite,-1);
int &fsize = 5;
int &felm = create_sprite(&felmx,&felmy,6,971,1);
sp_size(&felm,5);
sp_brain_parm(&felm, 400);
sp_brain(&felm, 12);
wait(3000);
sp_speed(&felm,1);
sp_target(&felm,1);
sp_base_walk(&felm,970);
loop:
&fsize += 1;
sp_size(&felm, &fsize);
wait(50); //adjest as needed
if (&fsize < 100)
goto loop;

Another posibiliy would be to use the shrink/grow brain but set it larger than you really want and stop it at 100, but that strikes me as likely to mess up unexpectedly.
April 23rd 2003, 05:10 AM
pq_frog.gif
Ric
Peasant They/Them Canada
 
Thanx guys. I have been useing loops with += to do this in the past, but it didn't work right this time. I thought the brain_parm might be cleaner. But now I changed the name of &felm , looped it to grow and it's working.o.k.
April 23rd 2003, 01:41 PM
custom_odd.gif
You could set the brain parm higher, and then have something check it constantly, and when it reaches size 400, change it's brain to normal.