How do a slash effect

Get help using Construct 2

Post » Tue May 08, 2012 9:06 pm

like in fruit ninja.


how create that kind of effect.
Prabably when hold left mouse button and move cursor create long or short slash delgado2012-05-08 21:07:12
B
103
S
25
G
43
Posts: 1,879
Reputation: 33,403

Post » Wed May 09, 2012 12:08 am

Commented example capx

This is mostly like drawing a line and playing an animation in the end.
With a bit of thinking about the events.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
276
S
103
G
84
Posts: 7,289
Reputation: 83,098

Post » Wed May 09, 2012 12:24 am

@Kyatric thank you very much, you show me lot of interesting things! I appreciate it! :)
B
103
S
25
G
43
Posts: 1,879
Reputation: 33,403

Post » Wed May 09, 2012 1:20 am

The real trick is making it curve! Very difficult!!
B
92
S
31
G
24
Posts: 3,191
Reputation: 32,669

Post » Wed May 09, 2012 8:42 am

@Kyatric i have one (maybe simple) question, how compare a dostance of slash if i want add sound. If slash is short- short sound and if its long- long sound ?
B
103
S
25
G
43
Posts: 1,879
Reputation: 33,403

Post » Wed May 09, 2012 8:47 pm

@delgado: I guess on "touch release" you can add subevents that will test dash.width

If dash.width < X => Play sound1
If dash.width > X and <Y => Play sound2
if dash.width > Y => Play sound3

Something like that.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
276
S
103
G
84
Posts: 7,289
Reputation: 83,098

Post » Wed May 09, 2012 9:48 pm

In fruit ninja slash sound is played even if you keep finger on the screen after the slash (no released touch event) and also begins when the slash start ... so perhaps it's more something about velocity checking ... and so need checking the range between previous and actual touch X/Y to give short or long sound ! it's not so easy and it's perhaps done with a lot of very small sounds playing after each others or a single sound but changing the playing speed of the sound itself !

Good luck, and i think many guys need this kind of effect so it's a really interesting post ;-pnaelian2012-05-09 21:55:27
B
18
S
5
G
3
Posts: 298
Reputation: 5,332

Post » Wed May 09, 2012 10:24 pm

I try with Height and Width before but if you said that i try one time
B
103
S
25
G
43
Posts: 1,879
Reputation: 33,403

Post » Thu May 17, 2012 10:50 pm

Hi, i picked up some old example from ROJOHound for something totally different and i got this.Fruit ninja slash

It can be better if you can finetune the Heigth for different distances from touch to Touchend.cesisco2012-05-17 22:51:01
B
36
S
11
G
9
Posts: 399
Reputation: 10,283

Post » Thu May 17, 2012 11:04 pm

WOOW this is too very cool :D
B
103
S
25
G
43
Posts: 1,879
Reputation: 33,403

Next

Return to How do I....?

Who is online

Users browsing this forum: bangoo, NetOne and 7 guests