Esempio n. 1
0
        public OPlatform(Vector2 location, Rectangle size)
            : base("oplatform", location)
        {
            dRect.Width = size.Width;
            dRect.Height = size.Height;

            hitbox = new Hitbox(size);
            Floor = new Floor(Rectangle.Empty)
            {
                IsMoving = true,
                IsPassable = true
            };
        }
Esempio n. 2
0
        /// <summary>
        /// Integrate a part to the final level
        /// </summary>
        /// <param name="yRelativeLocation">The "zero" y of level, determined by the spawn</param>
        private static void IntegrateCollisions(Level level, List<Rectangle> floors, int gridLeft, int yRelativeLocation)
        {
            foreach (Rectangle rect in floors)
            {
                Rectangle floorRect = new Rectangle(rect.X + gridLeft, rect.Y + yRelativeLocation, rect.Width, rect.Height);

                Floor floor = new Floor(floorRect);
                level.TempCollisionsMask.Add(floor);
            }
        }