clock

package
v2.4.0-alpha.6 Latest Latest
Warning

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

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

Documentation

Overview

Package clock manages game timers.

Index

Constants

View Source
const SyncWithFPS = -1

Variables

This section is empty.

Functions

func ActualFPS added in v2.4.0

func ActualFPS() float64

func ActualTPS added in v2.4.0

func ActualTPS() float64

func Update

func Update(tps int) int

Update updates the inner clock state and returns an integer value indicating how many times the game should update based on given tps. tps represents TPS (ticks per second). If tps is SyncWithFPS, Update always returns 1. If tps <= 0 and not SyncWithFPS, Update always returns 0.

Update is expected to be called 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