Exemplo n.º 1
0
        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();
        }
Exemplo n.º 2
0
 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);
 }
Exemplo n.º 3
0
 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>();
 }
Exemplo n.º 4
0
        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)];
        }
Exemplo n.º 5
0
        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();
        }
Exemplo n.º 6
0
        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();
        }
Exemplo n.º 7
0
 internal void SetBorders(Sides borders)
 {
     this.Borders = borders;
 }