Esempio n. 1
0
        private void TestCollidedThisFrame()
        {
            var firstEntity  = new Entities.CollidableEntity();
            var secondEntity = new Entities.CollidableEntity();

            var relationship = CollisionManager.Self.CreateRelationship(firstEntity, secondEntity);

            relationship.CollidedThisFrame.ShouldBe(false);

            var collided = relationship.DoCollisions();

            collided.ShouldBe(true);

            relationship.CollidedThisFrame.ShouldBe(true);


            firstEntity.X += 10000;
            firstEntity.ForceUpdateDependenciesDeep();

            collided = relationship.DoCollisions();

            collided.ShouldBe(false);

            relationship.CollidedThisFrame.ShouldBe(false);

            firstEntity.Destroy();
            secondEntity.Destroy();
        }
Esempio n. 2
0
        private void TestEntityVsShapeCollection()
        {
            var singleEntity = new Entities.CollidableEntity();

            // for now just testing that the method exists:
            var relationship = CollisionManager.Self.CreateRelationship(singleEntity, ShapeCollectionInstance);



            CollisionManager.Self.Relationships.Remove(relationship);
            singleEntity.Destroy();
        }