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

Tree Spirit doesn't respect ammunition #26

Open
Raijinili opened this issue Oct 20, 2020 · 0 comments
Open

Tree Spirit doesn't respect ammunition #26

Raijinili opened this issue Oct 20, 2020 · 0 comments

Comments

@Raijinili
Copy link
Contributor

The Tree Spirit has a max ammunition of 5,

this.maxAmmunition = 5;
this.ammunition = 5;

generating ammo every 2 seconds (20 frames)
if(this.ammunitionTimer <= 0){
if(this.ammunition < this.maxAmmunition)
this.ammunition += 1;
this.ammunitionTimer = 20;
}
else this.ammunitionTimer -= 1;

and using it up every shot
this.ammunition -= 1; // We lower the ammunition

However, nothing in the code actually prevents it from shooting if it doesn't have ammunition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant