示例#1
0
        /// <summary>
        /// Creates an EasyTopDownGameObject
        /// </summary>
        public EasyTopDownGame()
        {
            this.ScreenWidth = defaultScreenWidth;
            this.ScreenHeight = defaultScreenHeight;

            this.TargetElapsedTime = TimeSpan.FromSeconds(1 / 60f);
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";
            world = new World(Vector2.Zero);
            CollisionManager = new CollisionManager();
        }
示例#2
0
 /// <summary>
 /// Implementers should call this method to register a collision handler function with the physics engine.
 /// Whenever two objects of the given categories collide, the handlerFunction will be invoked.
 /// </summary>
 /// <param name="categoryOne">The first kind of object to check</param>
 /// <param name="categoryTwo">The second kind of obejct to check</param>
 /// <param name="handlerFunction">The function to call whenever two objects of the given kind collide</param>
 public void AddCollisionHandler(String categoryOne, String categoryTwo, Action <EasyGameComponent, EasyGameComponent> handlerFunction)
 {
     CollisionManager.AddHandler(categoryOne, categoryTwo, handlerFunction);
 }