ogallagher / refraction

Asynchronous multiplayer semi-turn-based game
Other
1 stars 0 forks source link

Limit ammo and shot speed #7

Closed ogallagher closed 3 years ago

ogallagher commented 3 years ago

Spamming unlimited shots throughout the round needs to be prevented, and shot count and speed limits can help with this.

ogallagher commented 3 years ago

Added ammo, clip_capacity, and clip_recharge_speed instance variables to the Player class to limit shot count and firing rate.

ogallagher commented 3 years ago

I also added a shot indicator, whose length = clip * (this.ammo/this.ammo_capacity) * shot_indicator_length. The clip recharges at clip_recharge_speed every frame.