using System; using System.Collections.Generic; using System.Linq; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.GamerServices; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; using Microsoft.Xna.Framework.Media; using BEPUphysics; using BEPUphysics.Entities.Prefabs; namespace XForge { public class Game2 : Microsoft.Xna.Framework.Game { GraphicsDeviceManager graphics; GraphicsDevice device; SpriteBatch spriteBatch; Space space; Box ground; SimpleCharacterController controller; public Game2() : base() { graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; } protected override void LoadContent() { device = graphics.GraphicsDevice; spriteBatch = new SpriteBatch(device); space = new Space(); space.ForceUpdater.Gravity = new Vector3(0, -9.81f, 0); ground = new Box(Vector3.Zero, 30, 5, 30); controller = new SimpleCharacterController(new Vector3(0, 50, 0), 5, 3, 5, 100); space.Add(ground); space.Add(controller.Body); space.Add(controller); base.LoadContent(); } protected override void Update(GameTime gameTime) { space.Update(); Console.WriteLine(controller.IsSupported + " " + controller.Body.WorldTransform.Translation.ToString()); base.Update(gameTime); } protected override void Draw(GameTime gameTime) { base.Draw(gameTime); } } }