Object Trails

Started by densming, Tue 20/01/2004 03:21:39

Previous topic - Next topic

densming

I want to put an effect in my game where an object moves across the screen and leaves trails in its wake, similar to the "Mouse Trails" feature for mouse cursors in Windows.  As the object goes by, it leaves a ghost-like trail behind it.  Anyone have a suggestion on how to do this?

Rui 'Trovatore' Pires

The only way I can think of is using the RAW functions, maybe RawDrawImage. Experiment with them, or wait for someone to post a more complete reply. :P
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

Gilbert

You can also use overlays and really objects, but the problem was that the limit can be easily maxed out.

The best option I can think of is to use characters, as you can use convenient functions such as FollowCharacterEx().

I'm too lazy to mock up any code for it tho.

Ishmael

#3
Something like:

Make the object a character, in this example it's scriptname is OBJ1. You can create trails for several objects (characters actually) using the SetCharacterView command.

When you want to set the trail for the object:

SetCharacterTransparency(TRAIL1, 30);
SetCharacterTransparency(TRAIL1, 60);
SetCharacterTransparency(TRAIL1, 85);
FollowCharacterEx(TRAIL1, OBJ1, 10, 0);
FollowCharacterEx(TRAIL2, OBJ1, 21, 0);
FollowCharacterEx(TRAIL3, OBJ1, 33, 0);

And just move the character, and it has trails:

MoveCharacter(OBJ1, -50, 150);

Will move the OBJ1 out of the screen from the left side. Set all the TRAIL# charcters to use the same view as the OBJ1 uses.

I haven't tested this, so tell me how it works. ;)
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

SMF spam blocked by CleanTalk