clock

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 29, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package clock manages game timers.

Index

Constants

View Source
const (
	DefaultTPS  = 60
	SyncWithFPS = -1
)

Variables

This section is empty.

Functions

func ActualFPS

func ActualFPS() float64

func ActualTPS

func ActualTPS() float64

func SetTPS

func SetTPS(newTPS int)

func TPS

func TPS() int

func UpdateFrame

func UpdateFrame() int

UpdateFrame updates the inner clock state and returns an integer value indicating how many times the game should update based on the current tps.

If tps is SyncWithFPS, UpdateFrame always returns 1. If tps <= 0 and not SyncWithFPS, UpdateFrame always returns 0.

UpdateFrame is expected to be called once per frame.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL