constructor stucture fixes
This commit is contained in:
@@ -1,33 +1,26 @@
|
||||
package constructor
|
||||
|
||||
import (
|
||||
"game/domain"
|
||||
"image/color"
|
||||
|
||||
"github.com/hajimehoshi/ebiten"
|
||||
)
|
||||
|
||||
const (
|
||||
screenWidth = 320
|
||||
screenHeight = 240
|
||||
)
|
||||
|
||||
type GameEngine struct {
|
||||
Context domain.Context
|
||||
Keyboard Keyboard
|
||||
Constructor Constructor
|
||||
}
|
||||
|
||||
func (g *GameEngine) Update(screen *ebiten.Image) error {
|
||||
g.Keyboard.Watch()
|
||||
g.Constructor.Controller.Watch()
|
||||
return nil
|
||||
}
|
||||
|
||||
func (g *GameEngine) Draw(screen *ebiten.Image) {
|
||||
if g.Keyboard.UpPressed() {
|
||||
if g.Constructor.Controller.UpPressed() {
|
||||
screen.Fill(color.White)
|
||||
}
|
||||
}
|
||||
|
||||
func (g *GameEngine) Layout(outsideWidth, outsideHeight int) (int, int) {
|
||||
return screenWidth, screenHeight
|
||||
return g.Constructor.GameSettings.ScreenSettings.Width, g.Constructor.GameSettings.ScreenSettings.Height
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user