How do I set power of bullet on release of power button

Get help using Construct 2

Post » Sun Dec 04, 2016 10:13 am

Hi,

I hope someone can help, I have a power button, when I hold it down the power bar moves up to 100 (like on a golf game, the longer you hold the button down the more power you see the bar go up)

Image

But I'm trying to fire a bullet only when the power button is released (using touch), matching the power at the point the button was released.

I hope this makes sense. :oops:
Thank you for your time.
B
10
S
3
Posts: 55
Reputation: 802

Post » Sun Dec 04, 2016 11:26 am

You need to link your bullet speed value to your bluepowerbar.Height or to the power variable but thats an extra action which may not be needed

of course you can make it variable by adding a 'scale factor' according to the Height distance moved...

so what I mean is....1 x 2 x 3 x 4 x power scaling....etc etc

it could be ramped how ever you like ..easy gentle ramps or steadily increasing ..or power ramping

its up to you

does that make sense to you?



:geek:
When in doubt..or you are lost in a Zombie apocalypse or someone is giving you a hard time..Remember one thing..... Read the Construct 2 Manual..it will save your life.:)
B
35
S
13
G
8
Posts: 318
Reputation: 7,685

Post » Sun Dec 04, 2016 12:44 pm

Change it to Is Touching >>> ADD 1 to power
Image Image Image
B
29
S
11
G
27
Posts: 730
Reputation: 17,002

Post » Mon Dec 05, 2016 9:20 am

Thanks guys,

I've done it, I needed to add disable and enable bullet to stop it from going until I've pressed and released the button.

Here is the code in case someone else one day needs it.

Image

Thanks
B
10
S
3
Posts: 55
Reputation: 802


Return to How do I....?

Who is online

Users browsing this forum: marcinkowski and 13 guests