The Daily Click ::. Forums ::. Klik Coding Help ::. Mouse Trails, Well, Active Object Trails
 

Post Reply  Post Oekaki 
 

Posted By Message

Kai Proton



Registered
  31/01/2005
Points
  201

Wii Owner
13th June, 2015 at 13/06/2015 16:22:37 -

Hi,
Im building a game that needs the player to have like mouse trails, or animation shadows like a super move in Street Fighter,

Ive been trying to figure out how to make a trail follow the player when invincible, but I cant get anything to work correctly,
has anyone else seen or done something like this, and could direct me the right way,
I first tried the paste into background, or course it worked like a charm, but I cannot figure out how to clean them up afterwards,

so I figured something with creating copies of the player object, and making them show up behind...
anyway, I cant figure it out, anyone know anything ??

Kai.

 
----------------------
Time for a Sexy Party!
----------------------

siven

I EAT ROCKS

Registered
  03/11/2008
Points
  604

Wii OwnerVIP Member
20th June, 2015 at 20/06/2015 18:40:06 -

its not to difficult. heres an example, but i never left comments so it doesnt explain itself. also its old, so there might be an easier way to do it, but this is one way.

http://www.mediafire.com/download/l1hh9xrf9pm909b/Head_Trip.mfa

 
[Game design makes my brain feel like its gonna explode.]

The_Antisony

At least I'm not Circy

Registered
  01/07/2002
Points
  1341

VIP MemberStarSnow
4th July, 2015 at 04/07/2015 00:44:20 -

This is an effect you'll want to use sparingly because you'll need to clone several active objects to trail behind your original. There's no way to simply apply a graphic effect, so RAM use is going to spike and your game might slow down if you use it too much.

So; you'll want your active object and a separate trail object. If your trail object is just a copy of the first object, you'll still need two of them. Now, jump into your trail object and create two alterable values. One called "Opacity" set to 255. The second called "Decay" - set it to 25.

Every 0:02 seconds:
Create Active("Trail") at (0,0) from Active("Original")

Always:
Subtract 1 from Active("Trail") alterable value "decay".
Add 5 to Active("Trail") alterable value "opacity".
Active("Trail") set semi-opacity to Active("Trail") alterable value "opacity".

Active("Trail") alterable value "decay" = 0:
Destroy Active("Trail")

You can play with the default decay value to make the trail longer or shorter. You could increase the "Every 0:00:02" event to reduce the number of trailing objects. Hope that helps!

 
ChrisD> Employer: Say, wanna see a magic trick?
ChrisD> Employee: Uhh… sure, boss.
ChrisD> Employer: Your job! It just disappeared! Pack your things and leave! Pretty good trick, huh?

siven

I EAT ROCKS

Registered
  03/11/2008
Points
  604

Wii OwnerVIP Member
13th July, 2015 at 13/07/2015 23:30:13 -

ive never really had any ram spikes from active trails, and i use them a lot lol. i could see where excessive use would cause it though. and i believe thats exactly what i did in that example lol. i think i also set it based on the decay number it set transparency so that it faded the farther behind you it was.

 
[Game design makes my brain feel like its gonna explode.]

UrbanMonk

BRING BACK MITCH

Registered
  07/07/2008
Points
  49566

Has Donated, Thank You!Little Pirate!ARGH SignKliktober Special Award TagPicture Me This Round 33 Winner!The Outlaw!VIP MemberHasslevania 2!I am an April FoolKitty
Picture Me This Round 32 Winner!Picture Me This Round 42 Winner!Picture Me This Round 44 Winner!Picture Me This Round 53 Winner!
14th July, 2015 at 14/07/2015 01:30:33 -

Yeah it's not the 90s anymore. I used to get slow downs with a lot of actives, but not anymore. I hit Fusion's limit before I ever see a framedrop.

 
n/a

siven

I EAT ROCKS

Registered
  03/11/2008
Points
  604

Wii OwnerVIP Member
18th July, 2015 at 18/07/2015 23:43:59 -

i cant quite say the same... i have had issues with my game celestia using waaay to many actives as particle effects that have caused minor slowdowns. but there were hundreds of moving particals being created per second. twas unintentional.

 
[Game design makes my brain feel like its gonna explode.]
   

Post Reply



 



Advertisement

Worth A Click