How do I switch weapons/attacks?

0 favourites
  • 7 posts
From the Asset Store
Zombie attack is a survival game, where you have 2 types of games: Killer and survival.
  • Hi!

    Im trying to make a game where 2 players battle each other, and i cant figure out how to switch weapons. Please keep in mind this is a mobile game. I want to make it to to when they touch an icon, it selects that weapon, so when they touch the screen, it disables movement and shoots the selected weapon.

    Please Help

    Thanks in advance

  • Think we'll need a little more info.

    As I see it, there are two ways to do it:

    1. Make all weapons as animation inside the same sprite (probably the method I would've used)

    2. Create different sprites with different weapons, and destroy/create weapons when weapons are selected

    Should it disable movement after weapon is selected, or when the player is shooting only? How do you want the player to be able to move again?

  • Ok. i would need different weapons to do different damages, and i would have a row of like 5 different buttons on the bottom of the screen, each would be a different weapon. when you click one of the buttons, i would need it to 1st disable movement, then, on next touch, i would want it to shoot the projectile, then re-enable movement.

    As for shooting. i would need to figure out how to see where the touch is relative to the actor, and then shoot the projectile at that angle.

    if it wouldnt be too much trouble, could you send an example of the code or project? im kinda new at construct 2


  • Tried to do a quick mock up. Is this close to what you're looking for?

    • Weapon selection
    • Fire towards location of touch

  • Yes! Thank you Very Much !! is there a way that after the player shoots, the weapon goes away? and a refresh time before you can shoot again?

    Thanks for all of your help

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Sure, just set weapon to invisble at the end of the shoot event.

  • Cool! Thank you Very much for all of your help!

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