Thank you! I'll keep that in mind.BrotSagtMist wrote: ↑Sat Oct 21, 2023 9:20 am
I would rather change it to something like
enemy.timer = Time+ enemy:getAttackSpeed()
Search found 4 matches
- Sat Oct 21, 2023 11:12 am
- Forum: Support and Development
- Topic: [SOLVED] Attack system based on DT
- Replies: 5
- Views: 7106
Re: [SOLVED] Attack system based on DT
- Sat Oct 21, 2023 7:33 am
- Forum: Support and Development
- Topic: [SOLVED] Attack system based on DT
- Replies: 5
- Views: 7106
Re: [SOLVED] Attack system based on DT
UPDATE Code in previous post was not working completely. I notice it this morning and was a bit upset, but i found solution pretty quick. Code: -- Attack player with given damage and attack speed for enemyIndex, enemy in pairs(Enemies) do enemy.timer = enemy.timer + dt if enemy:getTimer() >= enemy:...
- Fri Oct 20, 2023 11:58 am
- Forum: Support and Development
- Topic: [SOLVED] Attack system based on DT
- Replies: 5
- Views: 7106
Re: Attack system based on DT
I would: On enemy init save the global time value love.timer.getTime() + the waiting time for each attack. Then check during the game when the global time succeeds the saved value, act and repeat setting a new time mark. Using < instead == means no skips, no double acts during slowdowns etc. Thank ...
- Thu Oct 19, 2023 5:21 am
- Forum: Support and Development
- Topic: [SOLVED] Attack system based on DT
- Replies: 5
- Views: 7106
[SOLVED] Attack system based on DT
Hello everyone! I'm working on my first small game and I need some help from the community. Here's the deal, I need to implement an enemy attack system with support for attack speed. At the moment it looks like this: CurrentDelta = 0 function EnemiesAttack(object) local sumOfDamage = 0 if GetItemsCo...