Skip to content

Instantly share code, notes, and snippets.

@tgjones
Created December 18, 2010 11:00
Show Gist options
  • Save tgjones/746405 to your computer and use it in GitHub Desktop.
Save tgjones/746405 to your computer and use it in GitHub Desktop.
No doubt we'll need a visual editor at some point, but having this kind of API for the "engine" makes rapid prototyping a breeze.
scene.Children.Add(new GameObjectBuilder()
.WithMeshSource(b => b.Mesh(new Mesh(Content, "Cube")))
.WithMeshRenderer()
.WithBoxCollider(b => b.Size(new Vector3(10, 10, 10)))
.WithRigidBody()
.Position(new Vector3(100, 50, 100))
.Rotation(Vector3.Right, MathHelper.Pi / 8.0f)
.ToGameObject());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment