I have an array and if you collide with a weapon it adds that value to the array. So lets say I collide with Shotgun it will add into the array 0 shotgun and if I collide with another weapon lets say Crossbow in the array it will say now
0 Crossbow
1 Shotgun
so each weapon will get pushed up to the top
Then I have an instance variable set in the array that changes each time you scroll the mouse wheel up and down
if this instance variable = 0 it will be pistol animation set if it =1 it will be shot gun animation set So I still run in to the problem where if I have just the pistol and scroll it will not change animation because I have not collected another gun it will not shoot because the variable has changed .
Hopefully I have explained this all ... I will see about giving this for loop a try.