Refactoring: Avoid using const FPS

This commit is contained in:
Hajime Hoshi 2018-07-17 00:52:50 +09:00
parent 93f8c76310
commit 1626e40822
2 changed files with 4 additions and 2 deletions

View File

@ -82,7 +82,7 @@ func (c *graphicsContext) initializeIfNeeded() error {
} }
func (c *graphicsContext) Update(afterFrameUpdate func()) error { func (c *graphicsContext) Update(afterFrameUpdate func()) error {
updateCount := clock.Update(FPS) updateCount := clock.Update(defaultTPS)
if err := c.initializeIfNeeded(); err != nil { if err := c.initializeIfNeeded(); err != nil {
return err return err

4
run.go
View File

@ -29,10 +29,12 @@ import (
"github.com/hajimehoshi/ebiten/internal/ui" "github.com/hajimehoshi/ebiten/internal/ui"
) )
const defaultTPS = 60
// FPS represents how many times game updating happens in a second (60). // FPS represents how many times game updating happens in a second (60).
// //
// BUG: This actually represents TPS, not FPS. // BUG: This actually represents TPS, not FPS.
const FPS = 60 const FPS = defaultTPS
// CurrentFPS returns the current number of frames per second of rendering. // CurrentFPS returns the current number of frames per second of rendering.
// //