예제 #1
0
파일: ItemFactory.cs 프로젝트: zfogg/Bounce
        public static Obstacle CreateObstacle(PhysicalScene scene)
        {
            var obstacleTexture = BounceGame.ContentManager.Load<Texture2D>("obstacle");
            var o = new Obstacle(scene, obstacleTexture);

            return o;
        }
예제 #2
0
        private static bool doesObstacleIntersect(Obstacle o, List<Rectangle> rectangleList)
        {
            foreach (Rectangle rectangleToTest in rectangleList)
            {
                rectangleToTest.Inflate(10, 25);
                if (o.Rectangle.Intersects(rectangleToTest))
                    return true;
            }

            return false;
        }