- Home /
Making a sorted weapon system
This is not a system for a working game but it's something i want to figure out as an example. I want to make a system where the Weapons you collect are stored in an order and then be able to print (into the Debugger for now) a Message listing the Weapons in order going something like this: Your First Weapon is a Sword, Your Second Weapon is a Pistol, Your Thirs Weapon is a Gun, ... With the System only printing for the amount of guns collected and with each weapon getting assinged a number so that the weapons can get collected in any order and listed in the order they where collected. I want to do it like this because if a make the Sword always be the first weapon, then if i don't collect the Sword the "First Weapon" would not be collected eventhough i collected the Second one.
what you are asking is very simple. for a weapon system you would need a list or array of weapons. you would just have a simple index number that checks for a match before the weapon is issued and the index number is incremeted.
by the time you learn how to design your weapon system, your will have learned plenty to solve this small issue
Your answer
Follow this Question
Related Questions
A node in a childnode? 1 Answer
Orderrring a List Ascending or Descending C# Advanced 2 Answers
Sorting a list by three parameters (C#) 1 Answer
sort list of object and if items are the same use another vaue 2 Answers
sorting list by name 2 Answers