Closed ogallagher closed 3 years ago
Added ammo
, clip_capacity
, and clip_recharge_speed
instance variables to the Player
class to limit shot count and firing rate.
ammo_capacity
= total shots per matchclip_capacity
= total ammo is divided into clips to limit shot rateclip_recharge_speed
= proportion of clip recharged in one frameI 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.
Spamming unlimited shots throughout the round needs to be prevented, and shot count and speed limits can help with this.