Fruit Ninja Style Curved Slash?

Get help using Construct 2

Post » Thu Dec 27, 2012 9:45 pm

I've managed to create a slashing mechanic but when I studied Fruit Ninja's, it seems like they created this curving polygon ish looking stroke that follows and trails behind your movement.

Could you anyone give me advice or point me to the right direction to create something similar to this?
B
27
S
9
G
5
Posts: 108
Reputation: 5,744

Post » Fri Dec 28, 2012 12:39 am

@Yung: It may not be what you're looking for, but I was thinking you could have a particle object that moves with the mouse/touch stroke, emitting particles along the way. If you setup the particles correctly, the ones emitted first (at the beginning of the slash) would fade out first. The radius of particles could be small so it doesn't look like a burst but rather just a streak.

Another way might be to have a sprite image that stretches from the initial mouse/touch point to the termination point via scaling or just adjusting the width.
B
16
S
6
G
2
Posts: 152
Reputation: 3,764

Post » Fri Dec 28, 2012 1:43 am

@Space Ape: Thanks for the idea! I tried the particle, though it seems promising, it wasn't exactly what I needed. Besides the settings to get near what I want would not be good for performance. But it's definitely a good start.

I already have that one effect for the slashed effect, but for the slashing effect, I was looking more for a solution that allows curving.
B
27
S
9
G
5
Posts: 108
Reputation: 5,744

Post » Fri Dec 28, 2012 2:57 am

Proper curving is difficult. The only possibility I could think of would lie in the unofficial Canvas plugin but even then it's iffy.

Of course, there's probably a way to fake it reasonable well with segments, but that might take a bit of trial and error.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Fri Dec 28, 2012 3:00 am

Hmmmm... Hows about making a tiled background, something really small and semi-transparent, and creating that tiled background at the point of mouse/touch contact? If it was round and small, it should easily create a 'drawing' effect in the game. Setting a timer or other device to fade out the opacity and destroy it when the opacity is 0 could create a nice drawn curved effect.

I'm curious to see what kind of solution you come up with!
B
16
S
6
G
2
Posts: 152
Reputation: 3,764

Post » Fri Dec 28, 2012 10:11 am

@Yung , hi take a look at this post Slash effectcesisco2012-12-28 10:12:15
B
33
S
11
G
9
Posts: 381
Reputation: 10,153

Post » Wed Jan 02, 2013 6:22 pm

cesisco: Thanks for the link! I saw your example long ago and thought it was cool, but it kept crashing if I move it too fast.

Thanks for the help everyone. After quite some time of researching, this is the version I am going for, as it's easiest for me to understand and implement, without going to UID picking and looping.

Here's the capx, for those interested. It's not perfect, but it's good enough for me.

If any of the expert has a better and proper way to implement this, please do share.
B
27
S
9
G
5
Posts: 108
Reputation: 5,744

Post » Thu Jan 03, 2013 12:56 pm

@Yung C2 release100 broke my example, but Ashley made a new one to fix it.I will test your example as soon as i have the latest release installed.tks
B
33
S
11
G
9
Posts: 381
Reputation: 10,153


Return to How do I....?

Who is online

Users browsing this forum: Artpunk, Kagubro, Mirlas, zeneizel and 24 guests