mirror of
https://github.com/giongto35/cloud-game.git
synced 2026-07-25 02:57:24 +00:00
Rate limit to 60FPS
This commit is contained in:
parent
f772add831
commit
e459b4c28c
1 changed files with 4 additions and 1 deletions
|
|
@ -23,6 +23,8 @@ type Director struct {
|
|||
roomID string
|
||||
}
|
||||
|
||||
const FPS = 60
|
||||
|
||||
func NewDirector(roomID string, imageChannel chan *image.RGBA, inputChannel chan int) *Director {
|
||||
// func NewDirector(audio *Audio, imageChannel chan *image.RGBA, inputChannel chan int) *Director {
|
||||
director := Director{}
|
||||
|
|
@ -61,7 +63,8 @@ func (d *Director) Start(paths []string) {
|
|||
}
|
||||
|
||||
func (d *Director) Run() {
|
||||
for {
|
||||
c := time.Tick(time.Second / FPS)
|
||||
for range c {
|
||||
// quit game
|
||||
// TODO: Check if noone using
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue