User prompt
Create différents asset for each villager type
User prompt
Fix Bug: 'TypeError: this.seekResource is not a function' in this line: 'this.seekResource(this.state.substring(7).toLowerCase());' Line Number: 796
User prompt
Fix Bug: 'TypeError: this.seekResource is not a function' in this line: 'this.seekResource('food');' Line Number: 796
User prompt
Spawn a New villager every 0.1 second
User prompt
Fix villager not apairing
User prompt
Add 4 of each villager type at launch
User prompt
Fix Bug: 'Uncaught ReferenceError: Villager is not defined' in this line: 'Villager.prototype.isDoingSomething = function () {' Line Number: 771
User prompt
Fix Bug: 'Cannot read properties of undefined (reading 'villagers')' in this line: 'self.gameInstance.villagers.forEach(function (villager) {' Line Number: 7
User prompt
Villager need to have différents asset base on their job
User prompt
Add 4 of each type of villager at launch
User prompt
Fix Bug: 'Cannot read properties of undefined (reading 'villagers')' in this line: 'self.gameInstance.villagers.forEach(function (villager) {' Line Number: 7
User prompt
Add 8 new functionality
User prompt
Fix Bug: 'Cannot read properties of null (reading 'villagers')' in this line: 'self.parent.villagers.forEach(function (villager) {' Line Number: 7
User prompt
Fix Bug: 'Uncaught ReferenceError: Market is not defined' in this line: 'self.market = new Market();' Line Number: 1119
User prompt
Fix Bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'addChild')' in this line: 'self.addChild(self.weatherSystem);' Line Number: 807
User prompt
Fix Bug: 'Uncaught TypeError: this.addChild is not a function' in this line: 'this.addChild(this.weatherSystem);' Line Number: 807
User prompt
Fix Bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'addChild')' in this line: 'self.addChild(self.weatherSystem);' Line Number: 807
User prompt
Fix Bug: 'Uncaught TypeError: this.addChild is not a function' in this line: 'this.addChild(this.weatherSystem);' Line Number: 807
User prompt
Fix Bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'addChild')' in this line: 'self.addChild(weatherSystem);' Line Number: 807
User prompt
Add 5 New functionality
User prompt
Add 16 new functionality
User prompt
Add a building of each type
User prompt
Add a building of one type at launch
User prompt
Fix Bug: 'Uncaught TypeError: Cannot set properties of undefined (setting 'isTeaching')' in this line: 'self.isTeaching = false;' Line Number: 110
User prompt
Fix Bug: 'Uncaught TypeError: Cannot set properties of undefined (setting 'isTeaching')' in this line: 'self.isTeaching = false;' Line Number: 110
===================================================================
--- original.js
+++ change.js
@@ -1,4 +1,219 @@
+var Quarry = Container.expand(function () {
+ var self = Container.call(this);
+ self.quarryGraphics = self.createAsset('quarry', 'Quarry Graphics', 0.5, 0.5);
+ var positionInitializer = new PositionInitializer();
+ positionInitializer.initializeRandomPosition(self, self.quarryGraphics.width, self.quarryGraphics.height, function () {
+ return self.checkOverlapWithOtherBuildings();
+ });
+ self.extractStone = function (villager) {};
+});
+var Mill = Container.expand(function () {
+ var self = Container.call(this);
+ self.millGraphics = self.createAsset('mill', 'Mill Graphics', 0.5, 0.5);
+ var positionInitializer = new PositionInitializer();
+ positionInitializer.initializeRandomPosition(self, self.millGraphics.width, self.millGraphics.height, function () {
+ return self.checkOverlapWithOtherBuildings();
+ });
+ self.grindGrain = function (villager) {
+ if (villager.gameResources.food.amount >= 5) {
+ villager.gameResources.food.amount -= 5;
+ villager.flour += 10;
+ if (villager.flour > 100) villager.flour = 100;
+ }
+ };
+});
+var Smithy = Container.expand(function () {
+ var self = Container.call(this);
+ self.smithyGraphics = self.createAsset('smithy', 'Smithy Graphics', 0.5, 0.5);
+ var positionInitializer = new PositionInitializer();
+ positionInitializer.initializeRandomPosition(self, self.smithyGraphics.width, self.smithyGraphics.height, function () {
+ return self.checkOverlapWithOtherBuildings();
+ });
+ self.forgeTools = function (villager) {
+ if (villager.gameResources.rock.amount >= 3) {
+ villager.gameResources.rock.amount -= 3;
+ villager.tools += 1;
+ if (villager.tools > 10) villager.tools = 10;
+ }
+ };
+});
+var Herbalist = Container.expand(function () {
+ var self = Container.call(this);
+ self.herbalistGraphics = self.createAsset('herbalist', 'Herbalist Graphics', 0.5, 0.5);
+ var positionInitializer = new PositionInitializer();
+ positionInitializer.initializeRandomPosition(self, self.herbalistGraphics.width, self.herbalistGraphics.height, function () {
+ return self.checkOverlapWithOtherBuildings();
+ });
+ self.provideHerbs = function (villager) {
+ if (villager.gameResources.food.amount >= 1) {
+ villager.gameResources.food.amount -= 1;
+ villager.health += 5;
+ if (villager.health > 100) villager.health = 100;
+ }
+ };
+});
+var Watchtower = Container.expand(function () {
+ var self = Container.call(this);
+ self.watchtowerGraphics = self.createAsset('watchtower', 'Watchtower Graphics', 0.5, 0.5);
+ var positionInitializer = new PositionInitializer();
+ positionInitializer.initializeRandomPosition(self, self.watchtowerGraphics.width, self.watchtowerGraphics.height, function () {
+ return self.checkOverlapWithOtherBuildings();
+ });
+ self.lookout = function () {};
+});
+var Tavern = Container.expand(function () {
+ var self = Container.call(this);
+ self.tavernGraphics = self.createAsset('tavern', 'Tavern Graphics', 0.5, 0.5);
+ var positionInitializer = new PositionInitializer();
+ positionInitializer.initializeRandomPosition(self, self.tavernGraphics.width, self.tavernGraphics.height, function () {
+ return self.checkOverlapWithOtherBuildings();
+ });
+ self.serveDrinks = function (villagers) {
+ villagers.forEach(function (villager) {
+ villager.happiness += 5;
+ if (villager.happiness > 100) villager.happiness = 100;
+ });
+ };
+});
+var Church = Container.expand(function () {
+ var self = Container.call(this);
+ self.churchGraphics = self.createAsset('church', 'Church Graphics', 0.5, 0.5);
+ var positionInitializer = new PositionInitializer();
+ positionInitializer.initializeRandomPosition(self, self.churchGraphics.width, self.churchGraphics.height, function () {
+ return self.checkOverlapWithOtherBuildings();
+ });
+ self.holdService = function (villagers) {
+ villagers.forEach(function (villager) {
+ villager.faith += 1;
+ if (villager.faith > 100) villager.faith = 100;
+ });
+ };
+});
+var Barracks = Container.expand(function () {
+ var self = Container.call(this);
+ self.barracksGraphics = self.createAsset('barracks', 'Barracks Graphics', 0.5, 0.5);
+ var positionInitializer = new PositionInitializer();
+ positionInitializer.initializeRandomPosition(self, self.barracksGraphics.width, self.barracksGraphics.height, function () {
+ return self.checkOverlapWithOtherBuildings();
+ });
+ self.trainSoldiers = function (villagers) {
+ villagers.forEach(function (villager) {
+ villager.strength += 1;
+ if (villager.strength > 100) villager.strength = 100;
+ });
+ };
+});
+var Farm = Container.expand(function () {
+ var self = Container.call(this);
+ self.farmGraphics = self.createAsset('farm', 'Farm Graphics', 0.5, 0.5);
+ var positionInitializer = new PositionInitializer();
+ positionInitializer.initializeRandomPosition(self, self.farmGraphics.width, self.farmGraphics.height, function () {
+ return self.checkOverlapWithOtherBuildings();
+ });
+ self.plantCrops = function () {};
+});
+var Workshop = Container.expand(function () {
+ var self = Container.call(this);
+ self.workshopGraphics = self.createAsset('workshop', 'Workshop Graphics', 0.5, 0.5);
+ var positionInitializer = new PositionInitializer();
+ positionInitializer.initializeRandomPosition(self, self.workshopGraphics.width, self.workshopGraphics.height, function () {
+ return self.checkOverlapWithOtherBuildings();
+ });
+ self.craftItem = function (villager, item) {};
+});
+var FishingHut = Container.expand(function () {
+ var self = Container.call(this);
+ self.hutGraphics = self.createAsset('fishingHut', 'Fishing Hut Graphics', 0.5, 0.5);
+ var positionInitializer = new PositionInitializer();
+ positionInitializer.initializeRandomPosition(self, self.hutGraphics.width, self.hutGraphics.height, function () {
+ return self.checkOverlapWithOtherBuildings();
+ });
+ self.storeCatch = function (villager) {};
+});
+var GuardTower = Container.expand(function () {
+ var self = Container.call(this);
+ self.towerGraphics = self.createAsset('guardTower', 'Guard Tower Graphics', 0.5, 0.5);
+ var positionInitializer = new PositionInitializer();
+ positionInitializer.initializeRandomPosition(self, self.towerGraphics.width, self.towerGraphics.height, function () {
+ return self.checkOverlapWithOtherBuildings();
+ });
+ self.watch = function () {};
+});
+var Library = Container.expand(function () {
+ var self = Container.call(this);
+ self.libraryGraphics = self.createAsset('library', 'Library Graphics', 0.5, 0.5);
+ var positionInitializer = new PositionInitializer();
+ positionInitializer.initializeRandomPosition(self, self.libraryGraphics.width, self.libraryGraphics.height, function () {
+ return self.checkOverlapWithOtherBuildings();
+ });
+ self.study = function (villager) {
+ if (villager.gameResources.wood.amount >= 1) {
+ villager.gameResources.wood.amount -= 1;
+ villager.iq += 5;
+ if (villager.iq > 200) villager.iq = 200;
+ }
+ };
+});
+var Stable = Container.expand(function () {
+ var self = Container.call(this);
+ self.stableGraphics = self.createAsset('stable', 'Stable Graphics', 0.5, 0.5);
+ var positionInitializer = new PositionInitializer();
+ positionInitializer.initializeRandomPosition(self, self.stableGraphics.width, self.stableGraphics.height, function () {
+ return self.checkOverlapWithOtherBuildings();
+ });
+ self.provideHorse = function (villager) {
+ if (villager.gameResources.food.amount >= 5) {
+ villager.gameResources.food.amount -= 5;
+ villager.speed += 5;
+ if (villager.speed > 20) villager.speed = 20;
+ }
+ };
+});
+var TownHall = Container.expand(function () {
+ var self = Container.call(this);
+ self.townHallGraphics = self.createAsset('townHall', 'Town Hall Graphics', 0.5, 0.5);
+ var positionInitializer = new PositionInitializer();
+ positionInitializer.initializeRandomPosition(self, self.townHallGraphics.width, self.townHallGraphics.height, function () {
+ return self.checkOverlapWithOtherBuildings();
+ });
+ self.hostMeeting = function (villagers) {
+ villagers.forEach(function (villager) {
+ villager.happiness += 2;
+ if (villager.happiness > 100) villager.happiness = 100;
+ });
+ };
+});
+var Apothecary = Container.expand(function () {
+ var self = Container.call(this);
+ self.apothecaryGraphics = self.createAsset('apothecary', 'Apothecary Graphics', 0.5, 0.5);
+ var positionInitializer = new PositionInitializer();
+ positionInitializer.initializeRandomPosition(self, self.apothecaryGraphics.width, self.apothecaryGraphics.height, function () {
+ return self.checkOverlapWithOtherBuildings();
+ });
+ self.provideMedicine = function (villager) {
+ if (villager.gameResources.food.amount >= 2) {
+ villager.gameResources.food.amount -= 2;
+ villager.health += 10;
+ if (villager.health > 100) villager.health = 100;
+ }
+ };
+});
+var BlacksmithShop = Container.expand(function () {
+ var self = Container.call(this);
+ self.shopGraphics = self.createAsset('blacksmithShop', 'Blacksmith Shop Graphics', 0.5, 0.5);
+ var positionInitializer = new PositionInitializer();
+ positionInitializer.initializeRandomPosition(self, self.shopGraphics.width, self.shopGraphics.height, function () {
+ return self.checkOverlapWithOtherBuildings();
+ });
+ self.forgeWeapon = function (villager) {
+ if (villager.gameResources.wood.amount >= 5 && villager.gameResources.rock.amount >= 5) {
+ villager.gameResources.wood.amount -= 5;
+ villager.gameResources.rock.amount -= 5;
+ villager.gameResources.weapon.amount += 1;
+ }
+ };
+});
var Guard = Container.expand(function () {
var self = Container.call(this);
self.guardGraphics = self.createAsset('guard', 'Guard Graphics', 0.5, 0.5);
self.addChild(self.guardGraphics);
A background of a paysage with plain and without tree or montainbut no water see from the top in the air 100m by 100m Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
One human medieval villager in a warcraft 2 style Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
a house in a warcraft 2 style Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A tree a rock and crambery in a RTS style Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A heart comic style Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A cloud in a comic style Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A market in a RTS fantasy style Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
An Inn in a RTS fantasy style Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
An school in a RTS fantasy style Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
An bakery in a RTS fantasy style Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A well in a RTS fantasy style Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A tree in a rts style Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
An apple in a rts style Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A rock in a rts style Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A home in a RTS and fantasy style. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A brewery in a fantasy rts style. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A lumberjack in a fantasy rts style. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
a marketplace in a fantasy rts style. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
a festival in a fantasy rts style. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.