Refactoring

This commit is contained in:
Hajime Hoshi 2013-10-09 22:35:08 +09:00
parent 55331e2453
commit 129532692d
2 changed files with 1 additions and 5 deletions

View File

@ -53,4 +53,3 @@ func (game *Terminate) Update(context ebiten.GameContext) {
func (game *Terminate) Draw(context graphics.Context) { func (game *Terminate) Draw(context graphics.Context) {
} }

View File

@ -177,15 +177,12 @@ func Run(game ebiten.Game, screenScale int, title string) {
gameContext := &GameContext{ gameContext := &GameContext{
inputState: ebiten.InputState{-1, -1}, inputState: ebiten.InputState{-1, -1},
} }
draw := func(context graphics.Context) {
game.Draw(context)
}
for { for {
select { select {
case gameContext.inputState = <-input: case gameContext.inputState = <-input:
case <-tick: case <-tick:
game.Update(gameContext) game.Update(gameContext)
case ui.updating <- draw: case ui.updating <- game.Draw:
<-ui.updated <-ui.updated
} }
if gameContext.terminated { if gameContext.terminated {