示例#1
0
        private List <GameObject> markedForRemoval;             // A list of objects that will be removed after the frame's loops have ended.

        public RoomScene(LevelScene scene, byte roomID) : base()
        {
            // References
            this.scene           = scene;
            this.roomID          = roomID;
            this.collideSequence = new CollideSequence(this);

            // Components that don't need to be rebuilt on room reset.
            this.parallax        = ParallaxOcean.CreateOceanParallax(this);
            this.particleHandler = new ParticleHandler(this);
        }
示例#2
0
        public GameManager()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            Template = new Template();

            // Systems
            systems.Add(renderer              = new Renderer());
            systems.Add(collisionHandler      = new CollisionHandler());
            systems.Add(physicsHandler        = new PhysicsHandler());
            systems.Add(animationHandler      = new AnimationHandler(Content));
            systems.Add(stateHandler          = new StateHandler());
            systems.Add(particleSystemHandler = new ParticleSystemHandler());
            systems.Add(parallaxHandler       = new ParallaxHandler());
        }
示例#3
0
        public static void GenerateCloudLayout(ParallaxHandler pxHandler)
        {
            // Distant Clouds
            ParallaxClouds.AddCloud(pxHandler, "BG/CloudBlue1", 0.05f, 144);
            ParallaxClouds.AddCloud(pxHandler, "BG/CloudBlue1", 0.07f, 144);
            ParallaxClouds.AddCloud(pxHandler, "BG/CloudBlue1", 0.08f, 144);
            ParallaxClouds.AddCloud(pxHandler, "BG/CloudBlue1", 0.1f, 144);

            // Semi-Distant Clouds
            ParallaxClouds.AddCloud(pxHandler, "BG/CloudBlue2", 0.28f, 154);
            ParallaxClouds.AddCloud(pxHandler, "BG/CloudBlue2", 0.30f, 154);
            ParallaxClouds.AddCloud(pxHandler, "BG/CloudBlue2", 0.33f, 154);
            ParallaxClouds.AddCloud(pxHandler, "BG/CloudBlue2", 0.36f, 154);

            // Nearby Clouds
            ParallaxClouds.AddCloud(pxHandler, "BG/CloudBlue3", 0.5f, 216);
            ParallaxClouds.AddCloud(pxHandler, "BG/CloudBlue3", 0.6f, 216);
        }
示例#4
0
 public static void AddMountain(ParallaxHandler pxHandler, string spriteName, float parallaxDist, short width)
 {
     pxHandler.AddLoopingObject(spriteName, parallaxDist, ParallaxLoopFlag.Horizon, ParallaxLoopFlag.Horizon, 0, width);
 }
示例#5
0
 public static void GenerateMountainLayout(ParallaxHandler pxHandler)
 {
     ParallaxMountains.AddMountain(pxHandler, "BG/mountain1", 0.03f, 128);               // Furthest Mountain, Slowest
     ParallaxMountains.AddMountain(pxHandler, "BG/mountain2", 0.07f, 224);
     ParallaxMountains.AddMountain(pxHandler, "BG/mountain3", 0.11f, 282);               // Closest Mountain, Fastest
 }
示例#6
0
        public static void AddCloud(ParallaxHandler pxHandler, string spriteName, float parallaxDist, short width)
        {
            float xVel = CalcRandom.FloatBetween(-0.5f, 0.5f) * parallaxDist;             // Randomize X-Velocity

            pxHandler.AddLoopingObject(spriteName, parallaxDist, ParallaxLoopFlag.Skyline, ParallaxLoopFlag.Top, xVel, width);
        }