Character Trail: How? (Solved)

Started by Dualnames, Mon 08/03/2010 18:45:57

Previous topic - Next topic

Dualnames

Well, I pride myself in scripting. Mostly because it's written in such a complex way, that even the simplest function appears like something really out of the box. Now, what's today's menu. I want to have a character, that we will name cEgo To have its previous animation leave a trail of a transparent images of himself that will fade away.

It's the exact thing your mouse can do. But i want the mouse trail to fade away, but instead of using a mouse as a template use the current character sprite. I think with my lack of concentration skills it would take me forever.

Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Calin Leafshade

I did this for a certain unreleased platform game.

Basically each loop I grabbed the sprites from the few preceding frames of the run animation (using viewframe)
and then drew them to the background with progressively more tranparency.

Just make sure you offset each sprite from the main character sprite proportionally to the speed of the character (if your character just has a static speed like the normal AGS walking system then even that shouldnt be a problem)

Crimson Wizard

There's more simple and silly way to do this. NOTE: I never did this, but I guess it must work.
Create dummy characters, amount depends on your wish.
Each character has different transparency.
To achieve effect, position characters in a row and move the to new position each tick after the real character, also changing their View frames accordingly.

Dualnames

#3
Nice code there Calin, only I can't get it to update.

You're having this code run when player is pressing arrow keys. In my way, it's working when I'm placing it on mouse click, though the sprite remains on screen. I'm having 640x400 resolution, with low-resolution coordinates set to true. The room is scrollable and I'm using Ali's Smooth Parallax Module.

I think your platform code, is just based on laws for that certain game, and has no effect on mine, I'm going to do a different approach.
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

monkey0506

Regarding the sprite staying on the screen, when you call surface.Release you are overwriting the current background in memory with the DrawingSurface. This is a permanent change. So the next time you grab a DrawingSurface from the room's background, you are grabbing the modified one, not the original. Because of this I would expect the sprite to slowly solidify instead of fading out as expected.

You'll need to use DrawingSurface.Copy to duplicate the original background before you start drawing. The manual has an example on how to do this.

SMF spam blocked by CleanTalk