How make Afterimages when i jump.

Discussion and feedback on Construct 2

Post » Sun Jul 12, 2015 11:54 pm

Message: GibonArt can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
https://www.youtube.com/watch?v=Ya3GdsHgBbM
B
11
S
3
Posts: 55
Reputation: 815

Post » Mon Jul 13, 2015 5:05 am

I watched the video, then tried it out on an old platformer test I did ages ago and got it working in a couple minutes...

I cloned the playerimages object (that has all the animations in it). Renamed the cloned object afterimages, set its opacity to 50, and gave it the Fade behavior.

Then I added an event: playerobject Platform is jumping

then added actions:
playerimages Spawn afterimages
afterimages set animation to playerimages.AnimationName
afterimages set animation frame to playerimages.AnimationFrame
afterimages stop animation
afterimages Move behind playerimages

then added a subevent checking if playerimages is mirrored
then added the action afterimages set Mirrored

I found that made too many images (makes one every tick), so I added a delay variable to slow that down, which looks better. Setting delay to a bigger number makes less images...

if you want to create images while the player is falling as well as when he is going up (the second half of a jump is considered falling), then make the event where you check if the player is jumping an Or block, and add another condition checking if the player is falling.

Image
B
97
S
34
G
20
Posts: 438
Reputation: 17,790

Post » Mon Jul 13, 2015 6:21 am

That's a fantastic waste of VRAM there. I'll admit I used to do that back in my MMF2 days though lol. In C2 you can use the paster or canvas object by R0j0hound.

+Every 0.05 seconds
+Player is NOT on floor
-Create Paster at Player.x , Player.y
-Paste Player object

+Paster opacity > 0
-Subtract 240 * dt from Paster.opacity

+Paster opacity < or = to 0
-Destroy Paster object
Image
B
243
S
30
G
13
Posts: 1,787
Reputation: 18,770

Post » Mon Jul 13, 2015 3:52 pm

THANKS!!!
B
11
S
3
Posts: 55
Reputation: 815


Return to Construct 2 General

Who is online

Users browsing this forum: oozkaya and 6 guests