How do I make a charge shot, megaman X style?

Get help using Construct 2

Post » Thu Feb 04, 2016 6:50 pm

Hi guys!!

In my game, I'm trying to get the character to have two shots: the normal and super shot.

Normal Shot
Image
Only by pressing a button (Z).

Special Shot
Image
Pressing and holding the x button.

As you will see, on the charge shoot I have problems.

When you pressed the button exits the bullet and this should not be, like his range of motion.
I like this shot works like Megaman X by keeping the button for a while.

But I can not perform, does anyone know how I can do this?

I leave my event sheet
Image

I would appreciate it!!.

PD:Sorry for my English.
Cheers!!!
B
4
S
1
Posts: 5
Reputation: 470

Post » Thu Feb 04, 2016 8:53 pm

Try using a variable (example, charge set to 1) and "charge>0; key is down; every x seconds" subtract .5 from charge. "key is released; charge=0" fire charged shot (also a charge =/= 0 for normal shots).
B
25
S
6
G
6
Posts: 265
Reputation: 3,696

Post » Fri Feb 05, 2016 1:45 am

roracle wrote:Try using a variable (example, charge set to 1) and "charge>0; key is down; every x seconds" subtract .5 from charge. "key is released; charge=0" fire charged shot (also a charge =/= 0 for normal shots).


It should be like that?
Image
Now do not throw shooting and animation is infinitely. XD
B
4
S
1
Posts: 5
Reputation: 470

Post » Fri Feb 05, 2016 10:00 am

hold keyboard button, when key is down every 0.1 second add 1 to variable 'charge'
when charge is 10 and more and key is relased > spawn big projectile
B
109
S
26
G
46
Posts: 1,885
Reputation: 35,166

Post » Sun Feb 07, 2016 4:09 am

delgado wrote:hold keyboard button, when key is down every 0.1 second add 1 to variable 'charge'
when charge is 10 and more and key is relased > spawn big projectile


Thank you!!
But I get the shot, but I have followed your tips, the bullet did not exit.

I do not know if I'm making a mistake when distributing the conditions and actions.

Anyway I leave my event sheet.
Image
B
4
S
1
Posts: 5
Reputation: 470

Post » Sun Feb 07, 2016 8:09 am

Image

do like in this example

set variable 'charged' to player not to projectile
B
109
S
26
G
46
Posts: 1,885
Reputation: 35,166

Post » Sun Feb 07, 2016 7:29 pm

delgado wrote:Image

do like in this example

set variable 'charged' to player not to projectile



Thank you very much it works perfectly. :D

Thanks to everyone who helped me when I have a preview of the game, I will publish in WIP.
B
4
S
1
Posts: 5
Reputation: 470


Return to How do I....?

Who is online

Users browsing this forum: Laura_D, plinkie and 20 guests