mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 19:28:57 +01:00
Refactoring
This commit is contained in:
parent
55331e2453
commit
129532692d
@ -53,4 +53,3 @@ func (game *Terminate) Update(context ebiten.GameContext) {
|
||||
|
||||
func (game *Terminate) Draw(context graphics.Context) {
|
||||
}
|
||||
|
||||
|
@ -177,15 +177,12 @@ func Run(game ebiten.Game, screenScale int, title string) {
|
||||
gameContext := &GameContext{
|
||||
inputState: ebiten.InputState{-1, -1},
|
||||
}
|
||||
draw := func(context graphics.Context) {
|
||||
game.Draw(context)
|
||||
}
|
||||
for {
|
||||
select {
|
||||
case gameContext.inputState = <-input:
|
||||
case <-tick:
|
||||
game.Update(gameContext)
|
||||
case ui.updating <- draw:
|
||||
case ui.updating <- game.Draw:
|
||||
<-ui.updated
|
||||
}
|
||||
if gameContext.terminated {
|
||||
|
Loading…
Reference in New Issue
Block a user