add level skeleton
This commit is contained in:
@@ -4,11 +4,12 @@ type User struct {
|
||||
Name string
|
||||
}
|
||||
|
||||
type Player struct {
|
||||
type PlayerState struct {
|
||||
Name string
|
||||
}
|
||||
|
||||
type Context struct {
|
||||
Player Player
|
||||
User User
|
||||
PlayerState PlayerState
|
||||
User User
|
||||
Level int
|
||||
}
|
||||
|
||||
@@ -8,9 +8,11 @@ type Domain struct {
|
||||
Context Context
|
||||
MenuMap konstructor.MenuMap
|
||||
DialogMap konstructor.DialogMap
|
||||
Levels []konstructor.Level
|
||||
}
|
||||
|
||||
func (d *Domain) Init() {
|
||||
d.InitMenu()
|
||||
d.InitDialog()
|
||||
d.InitLevel()
|
||||
}
|
||||
|
||||
41
domain/level.go
Normal file
41
domain/level.go
Normal file
@@ -0,0 +1,41 @@
|
||||
package domain
|
||||
|
||||
import (
|
||||
"game/konstructor"
|
||||
)
|
||||
|
||||
func (d *Domain) InitLevel() {
|
||||
d.Levels = []konstructor.Level{
|
||||
{
|
||||
ID: "level_1",
|
||||
Name: "Level I.",
|
||||
Playgrounds: []konstructor.Playground{
|
||||
{
|
||||
Background: "level_1_playground_1.png",
|
||||
Objects: []konstructor.Object{
|
||||
{
|
||||
ID: "test_object",
|
||||
Position: konstructor.Position{
|
||||
X: 10,
|
||||
Y: 10,
|
||||
Z: 0,
|
||||
},
|
||||
Type: konstructor.ObjectType{
|
||||
ID: "test_object_type",
|
||||
RenderOptions: konstructor.RenderOptions{
|
||||
Image: "test_object.png",
|
||||
Width: 30,
|
||||
Height: 30,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func (d *Domain) GetLevel(index int) konstructor.Level {
|
||||
return d.Levels[index]
|
||||
}
|
||||
Reference in New Issue
Block a user