reduce bullet speed over time

Get help using Construct 2

Post » Sat Dec 24, 2011 1:50 pm

I already posted this topic but unfortunately no answers, So sorry for re-posting.

But i basically want to slow down a object thats using the bullet behavior over time, I think i need to use lerp() But im unsure how to use this :(

Any santa's little helpers around? :)

Thanks.
B
7
S
1
G
1
Posts: 32
Reputation: 881

Post » Sat Dec 24, 2011 1:54 pm

it depends on what exactly you want to do, but you can just set bulletspeed to speed var, and just substract from speedvar every ..seconds
ImageImage
B
61
S
19
G
6
Posts: 809
Reputation: 9,028

Post » Sat Dec 24, 2011 2:02 pm

@vtrix, When the players y is greater than a certain number then i want the bullet speed to reduce to 0 but smoothly,

I tried to set a variable :
minSpeed = 0

then when players y is greater than the number i chose, lerp(Player.speed,minSpeed,0.8) But it didnt work :(
B
7
S
1
G
1
Posts: 32
Reputation: 881

Post » Sat Dec 24, 2011 2:11 pm

isnt it like this, will need to check :)
lerp(Player.speed,minSpeed,0.8*dt)

yes this should work ?vtrix2011-12-24 14:12:56
ImageImage
B
61
S
19
G
6
Posts: 809
Reputation: 9,028

Post » Sat Dec 24, 2011 2:15 pm

How is your event exactly ?
B
58
S
13
G
10
Posts: 632
Reputation: 12,515

Post » Sat Dec 24, 2011 2:17 pm

Oh yeah, but its still not working.

Im setting the players current speed to 400 every tick, So it doesnt work :(
B
7
S
1
G
1
Posts: 32
Reputation: 881

Post » Sat Dec 24, 2011 2:19 pm

@Kiyoshi, Every tick i set the players speed to a global varaible 'Speed'

When its y position is greater than a target(have not decided yet) then i need its speed to slow down..
B
7
S
1
G
1
Posts: 32
Reputation: 881

Post » Sat Dec 24, 2011 2:19 pm

yes that will not work, just set the current speed once, otherwise it will overwrite the slowdown


just to this lerp(speed,0,0.8*td)



vtrix2011-12-24 14:25:16
ImageImage
B
61
S
19
G
6
Posts: 809
Reputation: 9,028

Post » Sat Dec 24, 2011 2:28 pm

@vtrix.
Hmm Thanks, Basically I think im approaching this wrong.

I need to be able to set the bullets speed to slow down once it hits that y position then replicate physics and speed up again. I know the bullet object has a built in physics property but i cannot use it in this case the controls are a little to complicated.

So a little breakdown:

Players y > (TargetY) - Slowdown Bullet object,

Players Y < (TargetY) Increase speed back to normal.

Take a look at this game,

http://www.youtube.com/watch?v=LUQqYkrKrK0

Its been quite popular on this forum, But it shows what im trying to achieve quite well, If the players y > than a certain y then it slows down and feels heavy.. Unless it hits a booster..
B
7
S
1
G
1
Posts: 32
Reputation: 881

Post » Sat Dec 24, 2011 4:17 pm

whaleRip.capx
(you really want to make the same game? just buy it and play it :D)
Last edited by Yann on Sun Sep 14, 2014 10:43 pm, edited 1 time in total.
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Next

Return to How do I....?

Who is online

Users browsing this forum: dadanwsd, DemantDigitalArt and 20 guests