コード例 #1
0
        public Room2(int x, int y) : base("room0", new Vector2D(x, y), new Rectangle(0, 64, 0, 0))
        {
            Renderable renderable = this.Components.Get <Renderable>();

            LabRoomBuilder rb = new LabRoomBuilder(16, 43, "lab_tileset");

            this.AddSegment(rb, new Rectangle(0, 0, 16, 8));   //Floor
            this.AddSegment(rb, new Rectangle(0, 11, 2, 9));   //Left Wall
            this.AddSegment(rb, new Rectangle(13, 16, 2, 6));  //Right Wall Upper
            this.AddSegment(rb, new Rectangle(13, 8, 3, 5));   //Right Wall Lower
            this.AddSegment(rb, new Rectangle(0, 19, 16, 18)); //Ceiling
            this.AddSegment(rb, new Rectangle(2, 11, 3, 2));
            this.AddSegment(rb, new Rectangle(10, 11, 3, 2));

            rb.Set(7, 7, false);

            rb.ResolveNeighbors();

            rb.Fill(new Rectangle(15, 3, 1, 8), new RoomTileRaw()
            {
                Enabled = true, Initialized = true, Neighbors = 0b11111011, TileMapOffset = new Vector2D(0, 256)
            });
コード例 #2
0
 protected void AddSegment(LabRoomBuilder rb, Rectangle rect)
 {
     rb.Fill(rect, true);
     this.AddCollision(CoordinateMode.Grid, new CollisionBox(rect.X, rect.Y, rect.Width, rect.Height));
 }