- Home /
*What are some ways of implementing a Mid Mission Weapons/Upgrade/Equipment store?
What are some ways of implementing a Mid Mission Weapons/Upgrade/Equipment store?
TLDR If I want to create a 'shop' system where the player's weapon changes based on what he bought/equipped, should I use a full inventory system or can this be done with an array?
Hello. I realize this is a multipart question. I will try to make it as specific as possible but general enough to hopefully help others. I have been searching through forums, did tutorials, read guides, and I feel like I'm close, but not quite 100% on a solution to this problem.
I am trying to create a game that has a play, earn, spend feedback loop (See Luftrausers, Knightmare Tower, Jetpack Joyride etc)
The main idea is that the player earns money during a round, but when he dies, he can use the money to upgrade his ship. To test, I am only doing the main weapon, but I wold like to expand into other equipment types.
I have done the excellent Inventory Tutorial by Awfulmedia Found Here: https://www.youtube.com/watch?v=f4Op-UdvdK0
The tutorial creates lists of items, which are custom datatypes that contain attributes like what the item id, an item icon, name etc. This becomes the player's inventory. Items are added using the Add method.
I have one class for the player's item, and a similar class for the shop's item. What I would like to do is have two different lists, one for the player and one for the store. When the player clicks an icon in the store, that item would be removed from the store's inventory, and be added to the player's inventory List<>.
What do I need to do to get both Lists to talk to each other? My initial thought is to call the player's inventory list in both scripts. Will this cause a problem?
Alternatively, If I'm only allowing the player to change his weapon, could I just do an array that houses the 'current weapon' that the player has equipped?
Apologies if this is still vague, let me know if anything needs clarification
Your answer
Follow this Question
Related Questions
Filling in an inventory list. 1 Answer
How i can make a script-made button interactable? 0 Answers