Exemplo n.º 1
0
func getTestAnimation() (*Animation, *core.EntityDB) {
	entityDB := core.NewEntityDB()

	behavior := NewAnimation(entityDB)

	return behavior, entityDB
}
Exemplo n.º 2
0
func getTestTransform() (*Transform, *core.EntityDB) {
	entityDB := core.NewEntityDB()

	behavior := NewTransform(entityDB)

	return behavior, entityDB
}
Exemplo n.º 3
0
func getTestGraphical() (*Graphical, *TestRenderer, *core.EntityDB) {
	entityDB := core.NewEntityDB()
	renderer := new(TestRenderer)

	graphical := NewGraphical(renderer, entityDB)

	return graphical, renderer, entityDB
}
Exemplo n.º 4
0
func getTestInput() (*Input, *TestInputQueue, *core.EntityDB) {
	entityDB := core.NewEntityDB()
	queue := new(TestInputQueue)

	input := NewInput(queue, entityDB)

	return input, queue, entityDB
}
Exemplo n.º 5
0
func (self *Game) initializeEngine() {
	self.entityDB = core.NewEntityDB()

	keyboard := input.NewKeyboard(self.window)
	mouse := input.NewMouse(self.window)
	self.inputDispatcher = input.NewInputDispatcher(self.config, keyboard, mouse)

	self.graphicalBehavior = behaviors.NewGraphical(self.renderer, self.entityDB)
	self.inputBehavior = behaviors.NewInput(self.inputDispatcher, self.entityDB)
	self.transformBehavior = behaviors.NewTransform(self.entityDB)

	self.loadBaseResources()
}
Exemplo n.º 6
0
func (self *Game) Run() {
	self.window = platform.NewOpenGLWindow(self.config)
	self.window.Open()

	self.entityDB = core.NewEntityDB()
	self.renderer = new(platform.OpenGLRenderer)
	self.Keyboard = input.NewKeyboard(self.window)
	self.Mouse = input.NewMouse(self.window)

	self.InputDispatcher = input.NewInputDispatcher(
		self.config,
		self.Keyboard,
		self.Mouse,
	)

	self.initializeBehaviors()
	self.loadAllMaterials()
	self.loadAllMeshes()
	self.initializeScene()

	self.mainLoop()
}