User prompt
Fix Bug: 'Uncaught TypeError: self.initializeClouds is not a function' in this line: 'self.initializeClouds();' Line Number: 413
User prompt
Fix Bug: 'Uncaught TypeError: self.initializeHouses is not a function' in this line: 'self.initializeHouses();' Line Number: 454
User prompt
Fix Bug: 'Uncaught TypeError: self.populateVillage is not a function' in this line: 'self.populateVillage();' Line Number: 429
User prompt
Fix Bug: 'Uncaught TypeError: self.populateVillage is not a function' in this line: 'self.populateVillage();' Line Number: 429
User prompt
Fix Bug: 'Uncaught TypeError: self.initializeClouds is not a function' in this line: 'self.initializeClouds();' Line Number: 413
User prompt
Fix Bug: 'Uncaught TypeError: self.initializeClouds is not a function' in this line: 'self.initializeClouds();' Line Number: 413
User prompt
Optimise
User prompt
Improve
User prompt
Improve
User prompt
Fix Bug: 'Uncaught ReferenceError: EmployingWorkPlace is not defined' in this line: 'var workplace = new EmployingWorkPlace();' Line Number: 423
User prompt
Fix Bug: 'Uncaught ReferenceError: ResourceDisplay is not defined' in this line: 'self.resourceDisplay = new ResourceDisplay(self.resources);' Line Number: 336
User prompt
Improve
User prompt
Improve villager mouvement for making them go where they want to go
User prompt
Villager move 4 time speeder
User prompt
Make villager move base on their iq
User prompt
Foc villager dont moving
User prompt
Fix
User prompt
Fix Bug: 'Uncaught ReferenceError: houses is not defined' in this line: 'houses.push(house);' Line Number: 416
User prompt
Fix Bug: 'Uncaught ReferenceError: houses is not defined' in this line: 'houses.push(house);' Line Number: 416
User prompt
Fix Bug: 'Uncaught ReferenceError: houses is not defined' in this line: 'houses.push(house);' Line Number: 416
User prompt
Fix Bug: 'Uncaught ReferenceError: houses is not defined' in this line: 'houses.push(house);' Line Number: 416
User prompt
Fix Bug: 'Uncaught ReferenceError: houses is not defined' in this line: 'houses.push(house);' Line Number: 416
User prompt
Fix Bug: 'Uncaught ReferenceError: houses is not defined' in this line: 'houses.push(house);' Line Number: 416
User prompt
Fix
User prompt
Fix
===================================================================
--- original.js
+++ change.js
@@ -227,8 +227,18 @@
});
var EmployingWorkPlace = Container.expand(function () {
var self = Container.call(this);
});
+var VillagerFactory = Container.expand(function (resources) {
+ var self = Container.call(this);
+ self.resources = resources;
+ self.createVillager = function (x, y, isBaby, iq) {
+ var villager = new Villager(self.resources, iq);
+ villager.initializePosition(x, y);
+ villager.setAge(isBaby);
+ return villager;
+ };
+});
Well.prototype.initialize = function () {
this.wellGraphics = this.createAsset('well', 'Well Graphics', .5, .5);
this.x = 2048 / 2 - 800;
this.y = 2732 / 2 - 600;
@@ -291,9 +301,9 @@
Game.prototype.createAndAddVillagerIfPossible = function () {
if (this.resources && this.resources.food.amount >= 10) {
var x = Math.random() * 2048;
var y = Math.random() * 2732;
- this.addVillager(this.createVillager(x, y));
+ this.addVillager(this.villagerFactory.createVillager(x, y, false, Math.random() * 50 + 50));
this.resources.food.amount -= 10;
}
};
Game.prototype.zoomOnVillagers = function (villagerA, villagerB) {
@@ -370,14 +380,8 @@
rock: new RockResource(100),
food: new FoodResource(100)
};
}
- Game.prototype.createVillager = function (x, y, isBaby, iq) {
- var villager = new Villager(this.resources, iq);
- villager.initializePosition(x, y);
- villager.setAge(isBaby);
- return villager;
- };
Villager.prototype.setAge = function (isBaby) {
if (isBaby) {
this.scale.x = 0.5;
this.scale.y = 0.5;
@@ -410,11 +414,12 @@
var cloud = new Cloud();
self.clouds.push(cloud);
self.cloudLayer.addChild(cloud);
}
- self.addVillager(self.createVillager(1024, 1366, false, Math.random() * 50 + 50));
+ self.villagerFactory = new VillagerFactory(self.resources);
+ self.addVillager(self.villagerFactory.createVillager(1024, 1366, false, Math.random() * 50 + 50));
for (var i = 0; i < 10; i++) {
- self.addVillager(self.createVillager(Math.random() * 2048, Math.random() * 2732, false, Math.random() * 50 + 50));
+ self.addVillager(self.villagerFactory.createVillager(Math.random() * 2048, Math.random() * 2732, false, Math.random() * 50 + 50));
}
self.market = new Market();
self.addChild(self.market);
Game.prototype.createHouse = function (x, y) {
@@ -454,8 +459,6 @@
workplace.x = Math.random() * 2048;
workplace.y = Math.random() * 2732;
self.workplaces.push(workplace);
self.addChild(workplace);
- self.villagerCreationInterval = LK.setInterval(function () {
- self.createAndAddVillagerIfPossible();
- }, 10000);
+ self.villagerCreationInterval = LK.setInterval(self.createAndAddVillagerIfPossible.bind(self), 10000);
});
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.