How do I make a dynamic "hold-jump" effect for a bullet?

Get help using Construct 2

Post » Sat Jan 10, 2015 6:30 am

I have a bullet projectile with gravity on it, and I want to experiment with holding the fire button as a way to prolong the strength of the gravity. I understand how to do this with platform behavior, but not for a bullet.

This is how I do it for the player's platform behavior.
Image
B
20
S
5
Posts: 108
Reputation: 1,473

Post » Sat Jan 10, 2015 7:28 am

Decrease speed and gravity by some amount on button push?
B
19
S
6
G
6
Posts: 1,101
Reputation: 5,646

Post » Sat Jan 10, 2015 7:55 am

the speed works, but I'd rather have it modify just the gravity, and it's strange because gravity is not an expression for spritename.bullet
B
20
S
5
Posts: 108
Reputation: 1,473

Post » Sat Jan 10, 2015 8:08 am

So I got my desired effect by splitting it up into two events based on the button status.

It's ugly and needs tuning but it works. However, my one last issue is that when you quickly shoot two of these bullets on screen at once, the holding affects both of their gravitys. I want the end projectile arc to be permanent for that projectile once you let go of the firing button. I tried experimenting with on button released but it yielded the same results.

Image
B
20
S
5
Posts: 108
Reputation: 1,473

Post » Sat Jan 10, 2015 12:19 pm

Have you tried adding an instance variable "Gravity" to the vials, setting it the the gravity you want, and then setting bullet gravity to Self.Gravity?
B
3
Posts: 9
Reputation: 193

Post » Sat Jan 10, 2015 7:55 pm

Yep, that works. Thanks!
B
20
S
5
Posts: 108
Reputation: 1,473


Return to How do I....?

Who is online

Users browsing this forum: Anna Nehves Br, divsyntax, volumetv and 20 guests