picking up/changing items

Get help using Construct 2

Post » Tue Apr 23, 2013 1:50 am

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?
B
4
G
1
Posts: 17
Reputation: 609

Post » Tue Apr 23, 2013 3:39 am

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.
B
15
S
4
G
1
Posts: 168
Reputation: 2,177

Post » Tue Apr 23, 2013 5:40 am

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...
B
49
S
11
G
10
Posts: 1,833
Reputation: 14,418

Post » Thu Apr 25, 2013 4:21 am

Thank you very much everyone I will get to this as soon as possible, but it should work.    :)
B
4
G
1
Posts: 17
Reputation: 609


Return to How do I....?

Who is online

Users browsing this forum: Radulepy and 6 guests

cron