Ejemplo n.º 1
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()
}
Ejemplo n.º 2
0
func (self *Game) initializeBehaviors() {
	self.inputBehavior = behaviors.NewInput(self.InputDispatcher, self.entityDB)
	self.transformBehavior = behaviors.NewTransform(self.entityDB)
	self.graphicalBehavior = behaviors.NewGraphical(self.renderer, self.entityDB)
	self.animBehavior = behaviors.NewAnimation(self.entityDB)
}