rename presenter to constructor (memoriem of Last Ninja)

This commit is contained in:
2023-06-30 17:16:17 +02:00
parent bd63d00ad9
commit dec8ad2fe0
5 changed files with 11 additions and 11 deletions

33
constructor/engine.go Executable file
View File

@@ -0,0 +1,33 @@
package constructor
import (
"game/domain"
"image/color"
"github.com/hajimehoshi/ebiten"
)
const (
screenWidth = 320
screenHeight = 240
)
type GameEngine struct {
Context domain.Context
Keyboard Keyboard
}
func (g *GameEngine) Update(screen *ebiten.Image) error {
g.Keyboard.Watch()
return nil
}
func (g *GameEngine) Draw(screen *ebiten.Image) {
if g.Keyboard.UpPressed() {
screen.Fill(color.White)
}
}
func (g *GameEngine) Layout(outsideWidth, outsideHeight int) (int, int) {
return screenWidth, screenHeight
}