picking up/changing items

0 favourites
  • 4 posts
From the Asset Store
Simplistic hyper-casual game with nature elements. Tap to switch between the 4 elements and reach a better score.
  • Hello all I know that this may already be addressed, but there are 500 pages and maybe I skimed over it on accident or it isn't there. Either way I am trying to make in my game a variation of items that the player can pick up and swap between, not an inventory.

    An example- knight wants to swap between weapons (frost to fire sword) How would I make this happen?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I wouldn't worry. I think the reason it was tough to find an answer was because there's a lot of different ways to do this.

    I'd suggest setting a global variable to tell which weapon or item you have selected (1 for fire sword, 2 for ice sword, etc), and set up sub-events under the event that triggers your attack for each weapon.

    I'd recommend a global variable so the player doesn't have to keep switching items/weapons when they transition between layouts.

  • Make it so that when your character runs over a weapon, that the weapon gets pinned to the correct image point in their hand. Set the name of the weapon object or it's UID in an instance variable of the player. When you run over another weapon, unpin the object (grab it's name or UID from the instance variable), and pick up the new weapon, rinse, repeat...

    For a simple base for this you can check my wall jump tutorial where I have a section that enables the wall jump via picking up a powerup. You could use a similar setup for your weapons. The link is in my signature.

    Hope this helps...

  • Thank you very much everyone I will get to this as soon as possible, but it should work.    :)

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