Added weapon drops and collection. New laser item asset.

This commit is contained in:
2024-11-22 17:57:16 -05:00
parent b3a8ef8c0f
commit 253c708d45
6 changed files with 151 additions and 4 deletions

View File

@@ -13,7 +13,7 @@ func NewHolster() *Holster {
activewp: gamedata.WeaponTypeGun,
}
holster.AddWeapon(NewGun())
holster.AddWeapon(NewLaser())
//holster.AddWeapon(NewLaser())
return holster
}
@@ -46,8 +46,9 @@ func (h *Holster) CycleWeapon() {
}
//keep searching until we find the next weapon that exists
var nextwp gamedata.WeaponType = h.activewp
for ok := false; !ok; {
nextwp := (h.activewp + 1) % gamedata.WeaponTypeMax
nextwp = (nextwp + 1) % gamedata.WeaponTypeMax
_, ok = h.guns[nextwp]
if ok {
h.activewp = nextwp