public World() { random = new Random(); this.tiles = new Tile[XSIZE][]; for (int i = 0; i < XSIZE; i++) { tiles[i] = new Tile[YSIZE]; for (int j = 0; j < YSIZE; j++) { tiles[i][j] = new Tile(new Vector2(IMGSIZE * i,IMGSIZE * j)); } } createHalls(); connectHalls(); markIntersections(); }
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>(); }
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); } } }