Esempio n. 1
0
        public Person(Vector2 position, World w)
        {
            this.id = currId++;
            this.position = position;

            this.personality = new Personality();

            this.relationships = new List<Relationship>();
            this.hobbies = new List<Hobby>();

            generateHobbies(hobbies);

            this.color = Color.Black;

            this.bubble = new Bubble(hobbies.First<Hobby>().id);

            this.dir = w.getValidDir(this.position);

            this.currentTile = w.getTiles(this.position).First<Tile>();
        }
Esempio n. 2
0
        public void update(World w)
        {
            this.position += dir;

            List<Tile> thing = w.getTiles(this.position);

            if (!thing.Contains(this.currentTile))
            {
                if (thing.Count > 0)
                {
                    this.currentTile = thing.First<Tile>();
                }
                else
                {
                    this.dir = Vector2.Zero;
                }

                if (this.currentTile.intersection)
                {
                    this.dir = w.getValidDir(this.position);
                }

            }
        }