コード例 #1
0
ファイル: EasyTopDownGame.cs プロジェクト: pinh3ad/EasyXNA
        /// <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
ファイル: EasyTopDownGame.cs プロジェクト: pinh3ad/EasyXNA
 /// <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);
 }