jmmk / clash-attack-sim

https://jmmk.github.io/clash-attack-sim/
Other
3 stars 1 forks source link

calculate when an attack happens #3

Closed jmmk closed 9 years ago

jmmk commented 9 years ago

Currently using modulo of frame-count and an entity's attack-speed, but this makes all entities with the same attack speed attack at the same exact time. Instead, once they get in range, they should set last-attacked to the current frame-count. When frame-count equals last-attacked + attack-speed, attack again and set last-attacked to current frame-count.