MCPcopy Create free account
hub / github.com/candybox2/candybox2.github.io / load

Method load

code/main/MainMap.ts:42–82  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

40
41 // Private methods
42 private load(): void{
43 // We erase the map
44 this.renderArea.resetAllButSize();
45
46 // We load the map itself
47 this.renderArea.resizeFromArray(Database.getAscii("maps/map"));
48 this.renderArea.drawArray(Database.getAscii("maps/map"));
49
50 // We add various locations
51 this.loadATree(143, 26);
52 if(Saving.loadBool("gridItemPossessedFortressKey")) this.loadFortress(117, 39);
53 this.loadTheDesert(114, 42);
54 this.loadVillage(150, 36);
55 this.loadLonelyHouse(159, 23);
56 if(Saving.loadBool("TheCavePattern_TreasureMapSawMap") == true && Saving.loadBool("TheCavePattern_TreasureMapFoundTreasure") == false) this.loadTreasure(163, 29);
57 if(Saving.loadBool("mainMapDoneDesert")){
58 this.loadFarm(115, 57);
59 this.loadBridge(99, 61);
60 this.loadCaveEntrance(52, 57);
61 this.loadWishingWell(55, 66);
62 if(Saving.loadBool("gridItemPossessedPogoStick") == false) this.loadMoutains(71, 52);
63 }
64 if(Saving.loadBool("mainMapDoneBridge")) this.loadSorceressHut(95, 68);
65 if(Saving.loadBool("mainMapDoneCaveEntrance")){
66 this.loadPier(44, 33);
67 this.loadForest(58, 30);
68 }
69 if(Saving.loadBool("mainMapDonePier")){
70 this.loadLighthouse(38, 16);
71 }
72 if(Saving.loadBool("mainMapDoneForest")){
73 this.loadCastleEntrance(88, 25);
74 this.loadTheHole(126, 25);
75 }
76 if(Saving.loadBool("mainMapDoneCastleEntrance")){
77 this.loadCastle(87, 17);
78 }
79 if(Saving.loadBool("dragonDone")){
80 this.loadDragon(92, 11);
81 }
82 }
83
84 // Private "go to" methods
85 private goToATree(): void{

Callers 1

constructorMethod · 0.95

Calls 15

loadATreeMethod · 0.95
loadFortressMethod · 0.95
loadTheDesertMethod · 0.95
loadVillageMethod · 0.95
loadLonelyHouseMethod · 0.95
loadTreasureMethod · 0.95
loadFarmMethod · 0.95
loadBridgeMethod · 0.95
loadCaveEntranceMethod · 0.95
loadWishingWellMethod · 0.95
loadMoutainsMethod · 0.95
loadSorceressHutMethod · 0.95

Tested by

no test coverage detected