示例#1
0
 public void insertNPC(NPC npc, int y, int x, int height, int width)
 {
     fillRectangle(true, y, x, height, width);
     for (int i = y; i < height + y; i++)
     {
         for (int j = x; j < width + x; j++)
         {
             insertNPCAtLocation(npc, i, j);
         }
     }
 }
示例#2
0
 private void fillLevel1TrafficMap()
 {
     NPC testNPC = new NPC(this, new Point(300, 1200), 0); // need to move creation of NPCS somewhere else
     NPC testNPC2 = new NPC(this, new Point(350, 1200), 0);
     NPC testNPC3 = new NPC(this, new Point(750, 750), 0);
     testNPC.setStationaryImage(Image.FromFile("../../../Images/NPCs/TestZones/TestZone/TestNPC/StationaryImage.png"));
     testNPC2.setStationaryImage(Image.FromFile("../../../Images/NPCs/TestZones/TestZone/TestNPC/LargeStationaryImage.png"));
     testNPC3.setStationaryImage(Image.FromFile("../../../Images/NPCs/TestZones/TestZone/TestNPC/LargeTallStationaryImage.png"));
     level1TrafficMap.insertNPC(testNPC, 1200, 300, 30, 30); //use npc height and width etc.
     level1TrafficMap.insertNPC(testNPC2, 1200, 350, 30, 30);
     level1TrafficMap.insertNPC(testNPC3, 750, 750, 30, 60);
     npcList.Add(testNPC);
     npcList.Add(testNPC2);
     npcList.Add(testNPC3);
 }
示例#3
0
 public void removeNPCfromList(NPC npc)
 {
     npcList.Remove(npc);
 }
示例#4
0
 public void addNPCtoList(NPC npc)
 {
     npcList.Add(npc);
 }
示例#5
0
 public void insertNPCAtLocation(NPC npc, int y, int x)
 {
     npcMap[y, x] = npc;
 }