feat: changed timer mecanic and mage tower
This commit is contained in:
@@ -30,6 +30,11 @@ void AutoTimer::reset() {
|
||||
}
|
||||
|
||||
bool Timer::update(std::uint64_t delta) {
|
||||
if (m_Waiting) {
|
||||
m_InternalTime = 0;
|
||||
m_Waiting = false;
|
||||
return true;
|
||||
}
|
||||
m_InternalTime += delta;
|
||||
if (m_InternalTime >= m_Interval) {
|
||||
m_InternalTime %= m_Interval;
|
||||
@@ -38,8 +43,13 @@ bool Timer::update(std::uint64_t delta) {
|
||||
return false;
|
||||
}
|
||||
|
||||
void Timer::wait() {
|
||||
m_Waiting = true;
|
||||
}
|
||||
|
||||
void Timer::reset() {
|
||||
m_InternalTime = 0;
|
||||
m_InternalTime = 0; // let the timer active once at the beginning
|
||||
m_Waiting = true;
|
||||
}
|
||||
|
||||
std::uint64_t getTime() {
|
||||
|
||||
Reference in New Issue
Block a user