rename to Constructor to Konstructor
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
package constructor
|
||||
package konstructor
|
||||
|
||||
import (
|
||||
"image/color"
|
||||
@@ -7,20 +7,20 @@ import (
|
||||
)
|
||||
|
||||
type GameEngine struct {
|
||||
Constructor Constructor
|
||||
Konstructor Konstructor
|
||||
}
|
||||
|
||||
func (g *GameEngine) Update(screen *ebiten.Image) error {
|
||||
g.Constructor.Controller.Watch()
|
||||
g.Konstructor.Controller.Watch()
|
||||
return nil
|
||||
}
|
||||
|
||||
func (g *GameEngine) Draw(screen *ebiten.Image) {
|
||||
if g.Constructor.Controller.UpPressed() {
|
||||
if g.Konstructor.Controller.UpPressed() {
|
||||
screen.Fill(color.White)
|
||||
}
|
||||
}
|
||||
|
||||
func (g *GameEngine) Layout(outsideWidth, outsideHeight int) (int, int) {
|
||||
return g.Constructor.GameSettings.ScreenSettings.Width, g.Constructor.GameSettings.ScreenSettings.Height
|
||||
return g.Konstructor.GameSettings.ScreenSettings.Width, g.Konstructor.GameSettings.ScreenSettings.Height
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package constructor
|
||||
package konstructor
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
@@ -1,4 +1,4 @@
|
||||
package constructor
|
||||
package konstructor
|
||||
|
||||
import (
|
||||
"log"
|
||||
@@ -23,18 +23,18 @@ type GameSettings struct {
|
||||
ScreenSettings ScreenSettings
|
||||
}
|
||||
|
||||
type Constructor struct {
|
||||
type Konstructor struct {
|
||||
Context ContextInterface
|
||||
Domain DomainInterface
|
||||
Controller Controller
|
||||
GameSettings GameSettings
|
||||
}
|
||||
|
||||
func (c Constructor) Init() {
|
||||
ebiten.SetWindowSize(c.GameSettings.ScreenSettings.Width, c.GameSettings.ScreenSettings.Height)
|
||||
ebiten.SetWindowTitle(c.GameSettings.Name)
|
||||
func (k Konstructor) Init() {
|
||||
ebiten.SetWindowSize(k.GameSettings.ScreenSettings.Width, k.GameSettings.ScreenSettings.Height)
|
||||
ebiten.SetWindowTitle(k.GameSettings.Name)
|
||||
if err := ebiten.RunGame(&GameEngine{
|
||||
Constructor: c,
|
||||
Konstructor: k,
|
||||
}); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package constructor
|
||||
package konstructor
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
14
main.go
14
main.go
@@ -1,8 +1,8 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"game/constructor"
|
||||
"game/domain"
|
||||
"game/konstructor"
|
||||
|
||||
"github.com/hajimehoshi/ebiten"
|
||||
)
|
||||
@@ -18,10 +18,10 @@ func main() {
|
||||
},
|
||||
},
|
||||
}
|
||||
constructor := constructor.Constructor{
|
||||
konstructor := konstructor.Konstructor{
|
||||
Domain: domain,
|
||||
Controller: constructor.Controller{
|
||||
KeyMap: constructor.KeyMap{
|
||||
Controller: konstructor.Controller{
|
||||
KeyMap: konstructor.KeyMap{
|
||||
Up: ebiten.KeyUp,
|
||||
Down: ebiten.KeyDown,
|
||||
Right: ebiten.KeyRight,
|
||||
@@ -32,13 +32,13 @@ func main() {
|
||||
Action3: ebiten.KeyEscape,
|
||||
},
|
||||
},
|
||||
GameSettings: constructor.GameSettings{
|
||||
GameSettings: konstructor.GameSettings{
|
||||
Name: "Game",
|
||||
ScreenSettings: constructor.ScreenSettings{
|
||||
ScreenSettings: konstructor.ScreenSettings{
|
||||
Width: 640,
|
||||
Height: 480,
|
||||
},
|
||||
},
|
||||
}
|
||||
constructor.Init()
|
||||
konstructor.Init()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user