Changing gun bullet types?

0 favourites
  • 14 posts
From the Asset Store
Simplistic hyper-casual game with nature elements. Tap to switch between the 4 elements and reach a better score.
  • Sorta new to construct here and I am trying to implement a bullet cycle. I have a single gun that I want to have different ability's depending on which ability is selected ("Arrow Keys") or ("D-Pad"). There will be 4 ability's in total. How would I go about changing a bullet type with a press of a button?

    Any help will be greatly appreciated and thanks in advance

  • You could have a global variable number and add 1 to it when you press right, subtract 1 when you press left presumably. Then in other events you have conditions GV=1 - set ability 1, GV=2 set ability 2 etc. If you have bullets shown in game, based on GV you can set the animation of the bullet and damage stats etc.

  • Thanks for the reply. How would I go about changing the ability's being that not all have bullet behavior? the idea was to have 4 different weapon types with the different ability's ("Change fall Speed" And "Shoot" etc. to cycle through the weapons with an array all with different sprites. now have decided to use 1 weapon sprite with different ability's and different ability sprites attached to the main weapon depending on which ability is active. sorry if I'm not making much sense on this I would attach the project if I had anything relevant to go off of.

  • The answer to the question is the same as above. If the global variable is a certain value then you set certain sprites on the weapon or do anything you need to do for the weapon to use that ability.

  • Awesome that did it!!! I really appreciate it. Thank you so much for help.

  • You could have a global variable number and add 1 to it when you press right, subtract 1 when you press left presumably. Then in other events you have conditions GV=1 - set ability 1, GV=2 set ability 2 etc. If you have bullets shown in game, based on GV you can set the animation of the bullet and damage stats etc.

    If possible could you show an example of this?

  • > You could have a global variable number and add 1 to it when you press right, subtract 1 when you press left presumably. Then in other events you have conditions GV=1 - set ability 1, GV=2 set ability 2 etc. If you have bullets shown in game, based on GV you can set the animation of the bullet and damage stats etc.

    If possible could you show an example of this?

    dropbox.com/s/pyxsk38qlbzc1mw/change%20ability.c3p

  • Okay so got that part to work plus getting the sprite animation to change to match.

    So for example i have a bullet that is nothing special, then I have an ice arrow that i want to do more damage and also stop the enemy for a moment. I can get the sprite to change but the damage stays as the default bullet.

  • Depends on what the events are for firing. For example if the global variable is now 2 and fires ice then you change the damage variable under the events for GV=2.

  • Okay so like this?

  • And the events for the damage?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It's working now, thank you for the help.

  • Yeah that looks fine if you are spawning different bullet objects :)

  • For my current skill level this is what is currently working for me, I plan to play around more.

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