@DaveTheCoder
Okay, so here is my idea for switching weapons with my scroll wheel. Since arrays have to start at zero and I don't want to make any more changes to my scroll wheel code (yet). I've made my array look like this:
var none = 1
var weapons = [none,pistol, shotgun, rifle]
To switch weapons through my array, I'll use a code like this:
weapons[current_weapon]
However, I'm still having problems finding a simple way to use this code to replace my wall of elif statements:
if current_weapon == 1:
pistol.visible = true
pistol.shoot()
else:
pistol.visible = false
if current_weapon == 2:
shotgun.visible = true
shotgun.shoot()
else:
shotgun.visible = false
if current_weapon == 3:
rifle.visible = true
rifle.shoot()
else:
rifle.visible = false
My plan was to do something like this:
weapons[current_weapon].visible.true
pistol.shoot()
However, I'm still running into problems. Any advice?