public RoomType(string roomName, RoomTypes type) { this.Tilemap = new Tilemap(); this.Tilemap.LoadMap(@"Content/rooms/" + roomName + ".tmx", 32, 32); this.Sides = new Sides(); this.Type = type; this.CheckSides(); }
public Block(BlockType type, Room room) { this.LoadTexture(Block.Graphic, Level.BLOCK_WIDTH, Level.BLOCK_HEIGHT); this.Type = type; this.Collidable = false; this.Immovable = true; this.Borders = new Sides(); this.SetupBlock(); this.Room = room; Block.BorderSourceRectangle = new Rectangle(0, 0, Block.BorderGraphic.Width, Block.BorderGraphic.Height); }
public Node() { Children = new List<Node>(1000); CollisionGroups = new List<string>(10); this.Active = true; this.Collidable = false; this.Touching = new Sides(); this.WasTouching = new Sides(); this.CollidableSides = new Sides(); this.CollidableSides.SetAllTrue(); this.Activities = new List<Activity>(); }
private RoomType GetRandomRoom(Sides sides) { List<RoomType> validRoomTypes = new List<RoomType>(this.NormalRoomTypes.Count); foreach (RoomType roomType in this.NormalRoomTypes) { if (roomType.Sides == sides) validRoomTypes.Add(roomType); } return validRoomTypes[Random.Next(0, validRoomTypes.Count)]; }
public Node() { Children = new List<Node>(1000); CollisionGroup = new List<string>(10); this.Active = true; this.Collidable = false; this.Touching = new Sides(); this.WasTouching = new Sides(); this.CollidableSides = new Sides(); this.CollidableSides.SetAllTrue(); this.Activities = new List<Activity>(); if(Node.RotationQuaternoin == null) Node.RotationQuaternoin = new Quaternion(); }
public virtual void Update(GameTime gameTime) { GameManager.UpdateCalls++; if (!this.Active) return; if (this.UpdateChildren) { int childrenCount = this.Children.Count; for (int i = 0; i < childrenCount; i++) { this.Children[i].Update(gameTime); this.Children[i].PreCollisionUpdate(gameTime); } } for (int i = 0; i < this.Activities.Count; i++) this.Activities[i].Update(gameTime); this.Velocity.Y += this.Mass * GameManager.Gravity; WasTouching = Touching; Touching = new Sides(); }
internal void SetBorders(Sides borders) { this.Borders = borders; }