mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-26 03:38:55 +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) {
|
func (game *Terminate) Draw(context graphics.Context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user