How do I create a 3 itens slot

Get help using Construct 2

Post » Wed Sep 02, 2015 10:45 pm

I want to create a platform game with a 3 itens slots on the interface. These 3 slots allows the player can carrying a total of only 3 itens. Thus, if the player is already carrying a total of 3 itens, he needs to discard a item and then take that he wants (the discard could be by an automatic way - i.e: the discard is made from right to left. So, when the 3 slots are filled, the item that will be discarded is that one that occupies the first slot from the left).
The itens will distributed along the level design and an item discarded will be stay where it was left. When a item is collected, an icon representing it is added on the slot.
Each slot have a hotkey, which must pressed to "use" that item.

The idea is use the right item in the right place to progress in the game (a mix of adventure and platform game). I am searching for information that could help me to figure out how I can create this item system, but I can't find anything.
B
2
Posts: 1
Reputation: 152

Post » Wed Sep 02, 2015 11:43 pm

There a re a couple of ways to do it. One uses an array so go read the array tutorial and the inventory tutorial on C2.

The simpler way is to use a place holder inside your inventory frame sprite for each of the 3 items.

When the player clicks on an item have it set position to the place holder.

Use a global variable for the number of items and when it reaches 4 just destroy the first item in the inventory and slide all the other items over to the next place holder.

Here is a game I created that uses a place holder not an array for controlling inventory:

https://www.scirra.com/arcade/undergrou ... ellar-1989
Banned User
B
28
S
7
G
58
Posts: 1,229
Reputation: 34,825


Return to How do I....?

Who is online

Users browsing this forum: worm1 and 18 guests