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

  • Hi guys!!

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

    Normal Shot

    Only by pressing a button (Z).

    Special Shot

    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

    I would appreciate it!!.

    PD:Sorry for my English.

    Cheers!!!

  • 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).

  • 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?

    Now do not throw shooting and animation is infinitely. XD

  • 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

  • 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.

  • do like in this example

    set variable 'charged' to player not to projectile

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • do like in this example

    set variable 'charged' to player not to projectile

    Thank you very much it works perfectly.

    Thanks to everyone who helped me when I have a preview of the game, I will publish in WIP.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)