示例#1
0
文件: core.go 项目: wmiller848/karma
func CreateGame(r renderer.GenericRenderer) *Game {
	r.UpdateCameraPos([3]float32{0, 0, -10})
	return &Game{
		renderer: r,
		paused:   false,
		Players:  []cognition.Player{},
		Entities: []GenericEntity{},
	}
}
示例#2
0
文件: actor.go 项目: wmiller848/karma
func CreateActor(config string, r renderer.GenericRenderer) *Actor {

	var vertices = []float32{
		//  X, Y, Z, U, V
		1.0, -1.0, 0.0, 1.0, 0.0,
		-1.0, 1.0, 0.0, 0.0, 1.0,
		-1.0, -1.0, 0.0, 0.0, 0.0,
		1.0, -1.0, 0.0, 1.0, 0.0,
		-1.0, 1.0, 0.0, 0.0, 1.0,
		1.0, 1.0, 0.0, 1.0, 1.0,
	}

	r.AddMesh(vertices, []string{"barb.png"})
	r.UpdateMeshPos(0, [3]float32{0, 0, 0})

	return &Actor{
		renderer: r,
		position: [4]float32{0, 0, 0},
	}
}