-
Notifications
You must be signed in to change notification settings - Fork 27
/
responder.go
35 lines (31 loc) · 998 Bytes
/
responder.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Copyright 2014-2016 Joseph Hager. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package engi
type Responder interface {
Render()
Resize(width, height float32)
Preload()
Setup()
Close()
Update(dt float32)
Mouse(x, y float32, action Action)
Scroll(amount float32)
Key(key Key, modifier Modifier, action Action)
Type(char rune)
}
type Game struct{}
func (g *Game) Preload() {}
func (g *Game) Setup() {}
func (g *Game) Close() {}
func (g *Game) Update(dt float32) {}
func (g *Game) Render() {}
func (g *Game) Resize(w, h float32) {}
func (g *Game) Mouse(x, y float32, action Action) {}
func (g *Game) Scroll(amount float32) {}
func (g *Game) Key(key Key, modifier Modifier, action Action) {
if key == Escape {
Exit()
}
}
func (g *Game) Type(char rune) {}