ebiten/example/game/terminate/terminate.go

28 lines
440 B
Go
Raw Normal View History

2013-07-16 18:42:53 +02:00
package terminate
import (
"github.com/hajimehoshi/go.ebiten"
"github.com/hajimehoshi/go.ebiten/graphics"
)
type Terminate struct {
life int
}
func New() *Terminate {
return &Terminate{60}
}
func (game *Terminate) Init(tf graphics.TextureFactory) {
}
func (game *Terminate) Update(context ebiten.GameContext) {
game.life--
if game.life <= 0 {
context.Terminate()
}
}
func (game *Terminate) Draw(context graphics.Context) {
}