Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add default weapon #5

Open
toledosq opened this issue Jan 17, 2024 · 0 comments
Open

Add default weapon #5

toledosq opened this issue Jan 17, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@toledosq
Copy link
Owner

Currently, the WeaponManager has an array that can store 2 weapon resources. This array is tied to the Weapon Slots in inventory. If a weapon slot is empty, then the array stores a value of NULL. The player is prevented from switching to a null slot at current time. This is a good start to ensure no null errors, but has led to the issue of the UI not updating correctly when no weapons are equipped.

The easiest solution, besides force refresh to default values, is to implement a default weapon. I am thinking fists (melee weapon).

I'll first need to address melee weapons in general. Then, I need to fill the array with melee, without it talking to the inventory. This can be achieved by storing the resource locally in the WeaponManager, and filling the slot when a weapon is unequipped.

PLEASE NOTE that when switching slots, the logic at current is to unequip and equip. Make sure to add control flow to unequip to know whether or not the inventory slot was swapped or entirely removed.

@toledosq toledosq self-assigned this Jan 17, 2024
@toledosq toledosq added the enhancement New feature or request label Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant