rpgtkoolmv / corescript

http://www.rpgmakerweb.com/products/programs/rpg-maker-mv
MIT License
311 stars 75 forks source link

Fix the game screen freezes occasionally even though you hear the sounds #191

Closed krmbn0576 closed 5 years ago

krmbn0576 commented 5 years ago

The problem of "the screen freezes extremely occasionally despite the sound being heard" was previously reported.

It turned out that the reason for this is that this._skipCount is a negative number. This is how it works.

  1. startTime is determined based on Date.now().
  2. During rendering, the OS corrects the clock and the time rewinds.
  3. endTime is determined based on Date.now().
  4. startTime > endTime so elapsed is negative.
  5. elapsed is negative so this._skipCount is negative.
  6. this._skipCount is negative so the game is no longer rendered.

Fixed!