Example #1
0
        //-----------------------------------------------------------------------------
        // Overridden methods
        //-----------------------------------------------------------------------------

        public override void OnInitialize()
        {
            startPosition = (IsVertical ? Location.Y : Location.X);
            returnTimer   = 0;
            TileRoller roller = this;

            do
            {
                firstRoller = roller;
                // Don't look any further, this is automatically the first roller.
                if (roller.Properties.GetBoolean("first_roller"))
                {
                    break;
                }
                roller = RoomControl.GetTopTile(roller.Location + Directions.ToPoint(IsVertical ? Directions.Left : Directions.Up)) as TileRoller;
            } while (roller != null);

            nextRoller = RoomControl.GetTopTile(Location + Directions.ToPoint(IsVertical ? Directions.Right : Directions.Down)) as TileRoller;
            // Don't include the next roller if it's the start of a new group.
            if (nextRoller != null && nextRoller.Properties.GetBoolean("first_roller"))
            {
                nextRoller = null;
            }

            pushed    = false;
            pushTimer = 0;

            Graphics.PlayAnimation(TileData.SpriteList[1].Animation);
            Graphics.AnimationPlayer.SkipToEnd();
        }
Example #2
0
        //-----------------------------------------------------------------------------
        // Overridden methods
        //-----------------------------------------------------------------------------
        public override void OnInitialize()
        {
            startPosition = (IsVertical ? Location.Y : Location.X);
            returnTimer = 0;
            TileRoller roller = this;
            do {
                firstRoller = roller;
                // Don't look any further, this is automatically the first roller.
                if (roller.Properties.GetBoolean("first_roller"))
                    break;
                roller = RoomControl.GetTopTile(roller.Location + Directions.ToPoint(IsVertical ? Directions.Left : Directions.Up)) as TileRoller;
            } while (roller != null);

            nextRoller = RoomControl.GetTopTile(Location + Directions.ToPoint(IsVertical ? Directions.Right : Directions.Down)) as TileRoller;
            // Don't include the next roller if it's the start of a new group.
            if (nextRoller != null && nextRoller.Properties.GetBoolean("first_roller"))
                nextRoller = null;

            pushed = false;
            pushTimer = 0;

            Graphics.PlayAnimation(TileData.SpriteList[1].Animation);
            Graphics.AnimationPlayer.SkipToEnd();
        }