mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-02-27 02:05:35 +01:00
28 lines
440 B
Go
28 lines
440 B
Go
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) {
|
|
}
|