User prompt
Create only one buble text by citizen
User prompt
Create two lumberjack at begining and stop spawning more
User prompt
Optimise conversation text fluidity
User prompt
Create only one lumberjack at begining
User prompt
Two lumberjack max and conversation text has to be close to the citizen who talk
User prompt
Fix Bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'push')' in this line: 'self.clouds.push(cloud);' Line Number: 1249
User prompt
Optimise
User prompt
Add 2 new conversation text
User prompt
Optimise conversation fluidity
User prompt
Add 2 new conversation
User prompt
Optimise conversation fluidity
User prompt
Buble live Only the Time of the conversation
User prompt
Fix conversation buble
User prompt
Fix Bug: 'Timeout.tick error: Cannot set properties of undefined (setting 'speed')' in this line: 'self.speed = 6;' Line Number: 989
User prompt
When talking citizen stop movement for one second
User prompt
Optimise talk fluidity
User prompt
Add new talk subject
User prompt
Conversation text are 10 pixel up the citizen talking
User prompt
Fix conversation text not showing
User prompt
Show conversation text
User prompt
Conversation take 2 second and citizen walk again after talking
User prompt
Show the conversation text and dont start a new talk if the last talk was less than 10 second earlier
User prompt
Fix Bug: 'ReferenceError: SpeechBubble is not defined' in this line: 'var speechBubble = new SpeechBubble(parent, question.q, self.delay);' Line Number: 435
User prompt
Add more conversation with question and answer. Each question can have 5 différent answer. Show the buble text
User prompt
Optimise talk a lot
var Teacher = Container.expand(function () {
var self = Container.call(this);
self.teacherGraphics = self.createAsset('teacher', 'Teacher Graphics', 0.5, 0.5);
self.educate = function (villager) {
if (villager.iq < 200) {
villager.iq += 0.1;
if (villager.iq > 200) villager.iq = 200;
}
};
LK.on('tick', function () {
self.parent.villagers.forEach(self.educate);
});
});
var Guardian = Container.expand(function () {
var self = Container.call(this);
self.guardianGraphics = self.createAsset('guardian', 'Guardian Graphics', 0.5, 0.5);
self.protect = function (villager) {};
LK.on('tick', function () {});
});
var Entertainer = Container.expand(function () {
var self = Container.call(this);
self.entertainerGraphics = self.createAsset('entertainer', 'Entertainer Graphics', 0.5, 0.5);
self.entertain = function (villager) {
if (villager.happiness < 100) {
villager.happiness += 1;
if (villager.happiness > 100) villager.happiness = 100;
}
};
LK.on('tick', function () {
self.parent.villagers.forEach(self.entertain);
});
});
var Builder = Container.expand(function () {
var self = Container.call(this);
self.builderGraphics = self.createAsset('builder', 'Builder Graphics', 0.5, 0.5);
self.buildingProgress = 0;
self.build = function (building) {
if (!building.isComplete) {
self.buildingProgress += 1;
if (self.buildingProgress >= 100) {
building.isComplete = true;
self.buildingProgress = 0;
}
}
};
});
var Healer = Container.expand(function (resources) {
var self = Container.call(this);
self.healerGraphics = self.createAsset('healer', 'Healer Graphics', 0.5, 0.5);
self.gameResources = resources;
self.healingPower = 5;
self.heal = function (villager) {
if (villager.health < 100) {
villager.health += self.healingPower;
if (villager.health > 100) villager.health = 100;
}
};
LK.on('tick', function () {
self.parent.villagers.forEach(self.heal);
});
});
var TownCrier = Container.expand(function () {
var self = Container.call(this);
self.crierGraphics = self.createAsset('townCrier', 'Town Crier Graphics', 0.5, 0.5);
self.x = 2048 / 2;
self.y = 2732 / 2;
self.announce = function (message) {
var announcement = new Text2(message, {
size: 100,
fill: "#ffffff"
});
announcement.x = self.x;
announcement.y = self.y - 200;
self.addChild(announcement);
LK.setTimeout(function () {
announcement.destroy();
}, 5000);
};
});
var VillagerBehavior = Container.expand(function (villager) {
var self = Container.call(this);
self.villager = villager;
self.decideNextAction = function () {
var needs = self.calculateNeeds();
var actions = self.defineActions();
var chosenAction = Object.keys(needs).find(need => needs[need]);
if (chosenAction) {
actions[chosenAction]();
} else {
actions['wander']();
}
};
self.calculateNeeds = function () {
return {
'rest': self.villager.energy < 20 || self.villager.tiredness >= 80,
'work': self.villager.energy >= 20 && self.villager.workplace && self.villager.tiredness < 80,
'food': self.villager.gameResources.food.amount < 20,
'wood': self.villager.gameResources.wood.amount < 20,
'rock': self.villager.gameResources.rock.amount < 20
};
};
self.defineActions = function () {
return {
'rest': function () {
self.villager.targetX = self.villager.home.x;
self.villager.targetY = self.villager.home.y;
self.villager.state = 'goingHomeToRest';
},
'work': function () {
self.villager.targetX = self.villager.workplace.x;
self.villager.targetY = self.villager.workplace.y;
self.villager.state = 'goingToWork';
},
'food': function () {
self.villager.state = 'seekingFood';
},
'wood': function () {
self.villager.state = 'seekingWood';
},
'rock': function () {
self.villager.state = 'seekingRock';
},
'trade': function () {
self.villager.state = 'trading';
self.villager.targetX = self.villager.marketplace.x;
self.villager.targetY = self.villager.marketplace.y;
},
'wander': function () {
self.villager.targetX = Math.random() * 2048;
self.villager.targetY = Math.random() * 2732;
self.villager.state = 'wandering';
}
};
};
});
var WeatherSystem = Container.expand(function (gameInstance) {
var self = Container.call(this);
self.gameInstance = gameInstance;
self.currentWeather = 'sunny';
self.changeWeather = function () {
var weathers = ['sunny', 'rainy', 'windy', 'snowy'];
self.currentWeather = weathers[Math.floor(Math.random() * weathers.length)];
if (self.gameInstance && self.gameInstance.villagers) {
self.gameInstance.villagers.forEach(function (villager) {
switch (self.currentWeather) {
case 'rainy':
villager.speed *= 0.9;
break;
case 'windy':
villager.speed *= 1.1;
break;
case 'snowy':
villager.speed *= 0.8;
break;
default:
villager.speed = villager.baseSpeed;
break;
}
});
}
};
LK.setInterval(self.changeWeather, 60000);
});
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 Windmill = Container.expand(function () {
var self = Container.call(this);
self.windmillGraphics = self.createAsset('windmill', 'Windmill Graphics', 0.5, 0.5);
var positionInitializer = new PositionInitializer();
positionInitializer.initializeRandomPosition(self, self.windmillGraphics.width, self.windmillGraphics.height, function () {
return self.checkOverlapWithOtherBuildings();
});
self.boostFarmProduction = function () {
var farms = self.parent.children.filter(function (child) {
return child instanceof Farm && self.intersects(child);
});
farms.forEach(function (farm) {
farm.productionMultiplier = (farm.productionMultiplier || 1) * 1.2;
});
};
LK.on('tick', self.boostFarmProduction);
});
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);
self.x = Math.random() * 2048;
self.y = Math.random() * 2732;
self.speed = 2;
self.isDaytime = true;
self.patrolArea = function () {
if (!self.isDaytime) {
var patrolX = Math.random() * 2048;
var patrolY = Math.random() * 2732;
self.moveTo(patrolX, patrolY, self.speed);
}
};
self.sleep = function () {
if (self.isDaytime) {
self.x = self.home.x;
self.y = self.home.y;
}
};
LK.on('tick', function () {
if (self.isDaytime) {
self.sleep();
} else {
self.patrolArea();
}
});
});
var Brewery = Container.expand(function () {
var self = Container.call(this);
self.breweryGraphics = self.createAsset('brewery', 'Brewery Graphics', 0.5, 0.5);
var positionInitializer = new PositionInitializer();
positionInitializer.initializeRandomPosition(self, self.breweryGraphics.width, self.breweryGraphics.height, function () {
return self.checkOverlapWithOtherBuildings();
});
self.produceBeverage = function () {
LK.setTimeout(function () {
self.parent.villagers.forEach(function (villager) {
villager.happiness += 5;
if (villager.happiness > 100) villager.happiness = 100;
});
}, 30000);
};
self.produceBeverage();
});
var SpeechBubble = Container.expand(function (parent, message, delay) {
var self = Container.call(this);
self.message = message;
self.delay = delay;
self.speechBubbleGraphics = self.createAsset('speechBubble', 'Speech Bubble Graphics', 0.5, 1);
self.text = new Text2(self.message, {
size: 100,
fill: "#ffffff"
});
self.text.anchor.set(0.5, 0);
self.text.y = -self.speechBubbleGraphics.height;
self.addChild(self.text);
parent.addChild(self);
self.x = parent.x;
self.y = parent.y - parent.height;
LK.setTimeout(function () {
self.destroy();
}, self.delay);
});
var Lumberjack = Container.expand(function (resources) {
var self = Container.call(this);
Lumberjack.prototype.talkTo = function (otherLumberjack) {
if (!this.isTalking && !otherLumberjack.isTalking) {
this.isTalking = true;
otherLumberjack.isTalking = true;
this.stopMoving();
otherLumberjack.stopMoving();
this.showSpeechBubble('Hello!');
otherLumberjack.showSpeechBubble('Hello!');
var self = this;
var other = otherLumberjack;
LK.setTimeout(function () {
self.resumeMoving();
other.resumeMoving();
self.isTalking = false;
other.isTalking = false;
}, 5000);
}
};
Lumberjack.prototype.stopMoving = function () {
this.originalSpeed = this.speed;
this.speed = 0;
};
Lumberjack.prototype.resumeMoving = function () {
this.speed = this.originalSpeed;
};
Lumberjack.prototype.showSpeechBubble = function (message) {
var speechBubble = new SpeechBubble(this, message, 5000);
};
self.lumberjackGraphics = self.createAsset('lumberjack', 'Lumberjack Graphics', 0.5, 0.5);
self.gameResources = resources;
self.choppingPower = 5;
self.targetX = Math.random() * 2048;
self.targetY = Math.random() * 2732;
self.speed = 6;
self.move = function () {
var dx = self.targetX - self.x;
var dy = self.targetY - self.y;
var distance = Math.sqrt(dx * dx + dy * dy);
if (distance < 5) {
self.targetX = Math.random() * 2048;
self.targetY = Math.random() * 2732;
} else {
self.x += dx / distance * self.speed;
self.y += dy / distance * self.speed;
}
};
LK.on('tick', function () {
self.move();
var nearbyLumberjacks = self.parent.children.filter(function (child) {
return child !== self && child instanceof Lumberjack && self.intersects(child);
});
if (nearbyLumberjacks.length > 0) {
self.talkTo(nearbyLumberjacks[0]);
}
});
self.chopTree = function (tree) {
if (tree instanceof Tree) {
self.gameResources.wood.amount += self.choppingPower;
tree.amount -= self.choppingPower;
if (tree.amount <= 0) {
tree.destroy();
}
}
};
});
var Miner = Container.expand(function (resources) {
var self = Container.call(this);
self.minerGraphics = self.createAsset('miner', 'Miner Graphics', 0.5, 0.5);
self.gameResources = resources;
self.miningPower = 5;
self.mineRock = function (rock) {
if (rock instanceof Rock) {
self.gameResources.rock.amount += self.miningPower;
if (self.gameResources.rock.amount > 100) self.gameResources.rock.amount = 100;
}
};
});
var Fisherman = Container.expand(function (resources) {
var self = Container.call(this);
self.fishermanGraphics = self.createAsset('fisherman', 'Fisherman Graphics', 0.5, 0.5);
self.gameResources = resources;
self.fishingPower = 5;
self.catchFish = function () {};
});
var PositionInitializer = Container.expand(function () {
var self = Container.call(this);
self.initializeRandomPosition = function (entity, width, height, overlapCheckCallback) {
do {
entity.x = Math.random() * (2048 - width) + width / 2;
entity.y = Math.random() * (2732 - height) + height / 2;
} while (entity.parent && overlapCheckCallback(entity));
};
});
var Building = Container.expand(function (assetName) {
var self = Container.call(this);
self.graphics = self.createAsset(assetName.toLowerCase(), assetName + ' Graphics', 0.5, 0.5);
self.checkOverlapWithOtherBuildings = function () {
var buildings = self.parent.children.filter(function (child) {
return child !== self && child instanceof Building;
});
return buildings.some(function (building) {
var dx = self.x - building.x;
var dy = self.y - building.y;
return Math.sqrt(dx * dx + dy * dy) < 300 + Math.max(self.graphics.width, self.graphics.height) / 2 + Math.max(building.graphics.width, building.graphics.height) / 2;
});
};
var positionInitializer = new PositionInitializer();
positionInitializer.initializeRandomPosition(self, self.graphics.width, self.graphics.height, self.checkOverlapWithOtherBuildings);
});
var School = Building.expand(function () {
var self = Building.call(this, 'School');
self.isTeaching = false;
self.teach = function (villager) {
if (!self.isTeaching) return;
villager.iq += 10;
};
self.startTeaching = function () {
self.isTeaching = true;
LK.setTimeout(function () {
self.isTeaching = false;
}, 20000);
};
});
var Resource = Container.expand(function (type, amount) {
var self = Container.call(this);
self.type = type;
self.resourceGraphics = self.createAsset(type.toLowerCase(), type + ' Graphics', 0.5, 0.5);
self.amount = amount;
self.collectResource = function (villager) {
if (self.amount > 0) {
var collectedAmount = Math.min(villager.collectingPower, self.amount);
villager.gameResources[self.type.toLowerCase()].amount += collectedAmount;
self.amount -= collectedAmount;
if (self.amount <= 0) {
self.destroy();
}
}
};
});
var Food = Resource.expand(function () {
var self = Resource.call(this, 'Food', 100);
});
var Rock = Resource.expand(function () {
var self = Resource.call(this, 'Rock', 100);
});
var ResourceDisplay = Container.expand(function (resources) {
var self = Container.call(this);
self.woodDisplay = self.addChild(new WoodDisplay(resources.wood));
self.rockDisplay = self.addChild(new RockDisplay(resources.rock));
self.foodDisplay = self.addChild(new FoodDisplay(resources.food));
self.positionDisplays();
});
var WoodDisplay = Container.expand(function (woodResource) {
var self = Container.call(this);
self.woodResource = woodResource;
var woodGraphics = self.createAsset('wood', 'Wood Resource Display', 0.5, 0.5);
self.addChild(woodGraphics);
self.woodText = new Text2(woodResource.amount.toString(), {
size: 50,
fill: "#ffffff"
});
self.woodText.position.set(woodGraphics.width / 2, woodGraphics.height + 20);
self.addChild(self.woodText);
});
var RockDisplay = Container.expand(function (rockResource) {
var self = Container.call(this);
self.rockResource = rockResource;
var rockGraphics = self.createAsset('rock', 'Rock Resource Display', 0.5, 0.5);
self.addChild(rockGraphics);
self.rockText = new Text2(rockResource.amount.toString(), {
size: 50,
fill: "#ffffff"
});
self.rockText.x = rockGraphics.width / 2;
self.rockText.y = rockGraphics.height + 20;
self.addChild(self.rockText);
});
var FoodDisplay = Container.expand(function (foodResource) {
var self = Container.call(this);
self.foodResource = foodResource;
var foodGraphics = self.createAsset('food', 'Food Resource Display', 0.5, 0.5);
self.addChild(foodGraphics);
self.foodText = new Text2(foodResource.amount.toString(), {
size: 50,
fill: "#ffffff"
});
self.foodText.x = foodGraphics.width / 2;
self.foodText.y = foodGraphics.height + 20;
self.addChild(self.foodText);
});
var Well = Container.expand(function () {
var self = Container.call(this);
self.wellGraphics = self.createAsset('well', 'Well Graphics', .5, .5);
var positionInitializer = new PositionInitializer();
positionInitializer.initializeRandomPosition(self, self.wellGraphics.width, self.wellGraphics.height, function () {
return self.checkOverlapWithOtherBuildings();
});
self.checkOverlapWithOtherBuildings = function () {
var buildings = self.parent.children.filter(function (child) {
return child !== self && child instanceof Building;
});
return buildings.some(function (building) {
var dx = self.x - building.x;
var dy = self.y - building.y;
return Math.sqrt(dx * dx + dy * dy) < 300 + Math.max(self.wellGraphics.width, self.wellGraphics.height) / 2 + Math.max(building.width, building.height) / 2;
});
};
positionInitializer.initializeRandomPosition(self, self.wellGraphics.width, self.wellGraphics.height, self.checkOverlapWithOtherBuildings);
self.drinkWater = function (villager) {
villager.tiredness -= 5;
if (villager.tiredness < 0) villager.tiredness = 0;
};
});
var Inn = Container.expand(function () {
var self = Container.call(this);
self.innGraphics = self.createAsset('inn', 'Inn Graphics', 0.5, 0.5);
self.initializeRandomPosition = function () {
do {
self.x = Math.random() * (2048 - self.innGraphics.width) + self.innGraphics.width / 2;
self.y = Math.random() * (2732 - self.innGraphics.height) + self.innGraphics.height / 2;
} while (self.parent && self.checkOverlapWithOtherBuildings());
};
self.checkOverlapWithOtherBuildings = function () {
var buildings = self.parent.children.filter(function (child) {
return child !== self && child instanceof Building;
});
return buildings.some(function (building) {
var dx = self.x - building.x;
var dy = self.y - building.y;
return Math.sqrt(dx * dx + dy * dy) < 300 + Math.max(self.innGraphics.width, self.innGraphics.height) / 2 + Math.max(building.width, building.height) / 2;
});
};
self.initializeRandomPosition();
self.isOccupiable = true;
self.occupy = function (villager) {
if (!self.isOccupiable) return;
self.isOccupiable = false;
villager.state = 'restingAtInn';
villager.tiredness = Math.max(villager.tiredness - 20, 0);
LK.setTimeout(function () {
self.isOccupiable = true;
}, 10000);
};
});
var Gardener = Container.expand(function () {
var self = Container.call(this);
self.homeGraphics = self.createAsset('home', 'Home Graphics', 0.5, 0.5);
do {
self.x = Math.random() * (2048 - self.homeGraphics.width) + self.homeGraphics.width / 2;
self.y = Math.random() * (2732 - self.homeGraphics.height) + self.homeGraphics.height / 2;
} while (self.parent && self.checkOverlapWithOtherBuildings());
self.checkOverlapWithOtherBuildings = function () {
var buildings = self.parent.children.filter(function (child) {
return child !== self && child instanceof Building;
});
return buildings.some(function (building) {
var dx = self.x - building.x;
var dy = self.y - building.y;
return Math.sqrt(dx * dx + dy * dy) < 200 + Math.max(self.homeGraphics.width, self.homeGraphics.height) / 2 + Math.max(building.width, building.height) / 2;
});
};
self.tendPlants = function () {};
self.plantNewTree = function () {
var newTree = new Tree();
newTree.x = Math.random() * 2048;
newTree.y = Math.random() * 2732;
if (self.parent) {
self.parent.addChild(newTree);
}
};
});
var Festival = Container.expand(function () {
var self = Container.call(this);
self.festivalGraphics = self.createAsset('festival', 'Festival Graphics', 0.5, 0.5);
self.x = 2048 / 2;
self.y = 2732 / 2 - 800;
self.isActive = false;
self.activateFestival = function () {
self.isActive = true;
self.parent.villagers.forEach(function (villager) {
villager.happiness += 20;
if (villager.happiness > 100) villager.happiness = 100;
});
LK.setTimeout(function () {
self.isActive = false;
self.parent.villagers.forEach(function (villager) {
villager.happiness -= 20;
if (villager.happiness < 0) villager.happiness = 0;
});
}, 30000);
};
});
var Heart = Container.expand(function () {
var self = Container.call(this);
self.showAbove = function (villager) {
self.x = villager.x;
self.y = villager.y - villager.height;
self.alpha = 1;
self.follow = function () {
if (villager) {
self.x = villager.x;
self.y = villager.y - villager.height;
}
};
LK.on('tick', self.follow);
LK.setTimeout(function () {
LK.off('tick', self.follow);
self.alpha = 1;
self.destroy();
}, 1000);
};
});
var Marketplace = Container.expand(function () {
var self = Container.call(this);
self.marketplaceGraphics = self.createAsset('marketplace', 'Marketplace Graphics', 0.5, 0.5);
self.availableResources = {
wood: 0,
rock: 0,
food: 0
};
self.trade = function (villager, resourceType, amount) {
if (self.availableResources[resourceType] >= amount) {
self.availableResources[resourceType] -= amount;
villager.gameResources[resourceType].amount += amount;
}
};
self.addResource = function (resourceType, amount) {
self.availableResources[resourceType] += amount;
};
self.initializePosition = function () {
if (!self.parent) return;
if (self.parent) {
self.x = Math.random() * 2048;
self.y = Math.random() * 2732;
}
};
self.initializePosition();
});
var Wood = Resource.expand(function () {
var self = Resource.call(this, 'Wood', 100);
});
var GoldResource = Resource.expand(function () {
var self = Resource.call(this, 'Gold', 50);
self.collectResource = function (villager) {
if (self.amount > 0) {
var collectedAmount = Math.min(villager.collectingPower, self.amount);
villager.gameResources.gold.amount += collectedAmount;
self.amount -= collectedAmount;
if (self.amount <= 0) {
self.destroy();
}
}
};
});
var FoodResource = Resource.expand(function () {
var self = Resource.call(this, 'Food', 100);
});
var Tree = Container.expand(function () {
var self = Container.call(this);
self.resourceType = 'food';
self.amount = 100;
self.collectResource = function (villager) {
if (self.amount > 0) {
var collectedAmount = Math.min(50, self.amount);
villager.gameResources.food.amount += collectedAmount;
villager.carriedFood += collectedAmount;
self.amount -= collectedAmount;
if (self.amount <= 0) {
self.destroy();
}
}
};
});
var Farmer = Container.expand(function (resources) {
var self = Container.call(this);
self.farmerGraphics = self.createAsset('farmer', 'Farmer Graphics', 0.5, 0.5);
self.gameResources = resources;
self.plantCrops = function () {};
self.harvestCrops = function () {};
});
var Blacksmith = Container.expand(function (resources) {
var self = Container.call(this);
self.blacksmithGraphics = self.createAsset('blacksmith', 'Blacksmith Graphics', 0.5, 0.5);
self.gameResources = resources;
self.forgeTool = function () {};
self.forgeWeapon = function () {};
});
var Merchant = Container.expand(function (resources) {
var self = Container.call(this);
self.merchantGraphics = self.createAsset('merchant', 'Merchant Graphics', 0.5, 0.5);
self.gameResources = resources;
self.tradeWithMarketplace = function (marketplace, resourceType, amount) {
if (marketplace.availableResources[resourceType] >= amount) {
marketplace.availableResources[resourceType] -= amount;
self.gameResources[resourceType].amount += amount;
}
};
self.tradeWithVillager = function (villager, resourceType, amount) {
if (self.gameResources[resourceType].amount >= amount) {
self.gameResources[resourceType].amount -= amount;
villager.gameResources[resourceType].amount += amount;
}
};
});
var DayNightCycleManager = Container.expand(function () {
var self = Container.call(this);
self.cycleDuration = 24000;
self.startTime = Date.now();
self.timeOfDayText = self.createTimeOfDayText();
LK.gui.topCenter.addChild(self.timeOfDayText);
LK.on('tick', function () {
var currentTime = Date.now();
var elapsedTime = (currentTime - self.startTime) / 1000;
var hours = Math.floor(elapsedTime % 24);
var minutes = Math.floor(elapsedTime % 1 * 60);
self.timeOfDayText.setText(hours + ':' + (minutes < 10 ? '0' : '') + minutes);
self.updateVillagerBehaviorBasedOnTime(hours);
});
self.updateVillagerBehaviorBasedOnTime = function (hours) {
var isDaytime = hours >= 6 && hours < 18;
self.parent.villagers.forEach(function (villager) {
villager.isDaytime = isDaytime;
});
};
});
var VillagerFactory = Container.expand(function (resources) {
var self = Container.call(this);
self.resources = resources;
self.createVillager = function (iq) {
return new Villager(self.resources, iq);
};
self.initializeAndAddVillager = function (isBaby, iq, x, y) {
var villager = this.createVillager(iq);
villager.setAge(isBaby);
villager.speed /= 2;
if (this.parent) {
this.parent.addChild(villager);
}
return villager;
};
});
var Bakery = Container.expand(function () {
var self = Container.call(this);
self.bakeryGraphics = self.createAsset('bakery', 'Bakery Graphics', 0.5, 0.5);
self.initializeRandomPosition = function () {
do {
self.x = Math.random() * (2048 - self.bakeryGraphics.width) + self.bakeryGraphics.width / 2;
self.y = Math.random() * (2732 - self.bakeryGraphics.height) + self.bakeryGraphics.height / 2;
} while (self.parent && self.checkOverlapWithOtherBuildings());
};
self.checkOverlapWithOtherBuildings = function () {
var buildings = self.parent.children.filter(function (child) {
return child !== self && child instanceof Building;
});
return buildings.some(function (building) {
var dx = self.x - building.x;
var dy = self.y - building.y;
return Math.sqrt(dx * dx + dy * dy) < 300 + Math.max(self.bakeryGraphics.width, self.bakeryGraphics.height) / 2 + Math.max(building.width, building.height) / 2;
});
};
self.bakeBread = function (villager) {
if (villager.gameResources.wood.amount >= 5 && villager.gameResources.food.amount >= 2) {
villager.gameResources.wood.amount -= 5;
villager.gameResources.food.amount -= 2;
villager.gameResources.food.amount += 10;
if (villager.gameResources.food.amount > 100) villager.gameResources.food.amount = 100;
}
};
});
var Cloud = Container.expand(function () {
var self = Container.call(this);
self.initializeMovement = function (speed) {
self.speed = speed * 1.5;
self.cloudGraphics = self.createAsset('cloud', 'Cloud Graphics', 0.5, 0.5);
self.addChild(self.cloudGraphics);
self.move = function () {
self.x += self.speed;
if (self.x > 2048) {
self.x = -self.cloudGraphics.width;
}
};
LK.on('tick', self.move);
};
});
var EmployingWorkPlace = Container.expand(function () {
var self = Container.call(this);
});
var RockResource = Container.expand(function (amount) {
var self = Container.call(this);
self.type = 'Rock';
self.amount = amount;
self.collect = function (villager) {};
});
var Home = Container.expand(function () {
var self = Container.call(this);
self.homeGraphics = self.createAsset('home', 'Home Graphics', 0.5, 0.5);
self.initializeRandomPosition = function () {
do {
self.x = Math.random() * (2048 - self.homeGraphics.width) + self.homeGraphics.width / 2;
self.y = Math.random() * (2732 - self.homeGraphics.height) + self.homeGraphics.height / 2;
} while (self.parent && self.checkOverlapWithOtherBuildings());
};
self.checkOverlapWithOtherBuildings = function () {
var buildings = self.parent.children.filter(function (child) {
return child !== self && child instanceof Building;
});
return buildings.some(function (building) {
var dx = self.x - building.x;
var dy = self.y - building.y;
return Math.sqrt(dx * dx + dy * dy) < 300 + Math.max(self.homeGraphics.width, self.homeGraphics.height) / 2 + Math.max(building.width, building.height) / 2;
});
};
var positionInitializer = new PositionInitializer();
positionInitializer.initializeRandomPosition(self, self.width, self.height, function () {
return self.checkOverlapWithOtherBuildings();
});
});
var Trader = Container.expand(function (resources) {
var self = Container.call(this);
self.traderGraphics = self.createAsset('trader', 'Trader Graphics', 0.5, 0.5);
self.addChild(self.traderGraphics);
self.gameResources = resources;
self.trade = function (resourceType, amount, targetResourceType) {
if (self.gameResources[resourceType].amount >= amount) {
self.gameResources[resourceType].amount -= amount;
self.gameResources[targetResourceType].amount += amount * self.getExchangeRate(resourceType, targetResourceType);
}
};
self.getExchangeRate = function (resourceType, targetResourceType) {
return 1;
};
});
var Villager = Container.expand(function (resources, iq) {
var self = Container.call(this);
self.gameResources = resources;
self.iq = iq;
self.moveTo = function (targetX, targetY, speed) {
var dx = targetX - self.x;
var dy = targetY - self.y;
var distance = Math.sqrt(dx * dx + dy * dy);
if (distance > 1) {
self.x += dx / distance * speed;
self.y += dy / distance * speed;
}
};
self.performBehavior = function () {
self.wanderRandomly();
};
self.wanderRandomly = function () {
if (!self.targetX || !self.targetY || self.hasReachedTarget(self.targetX, self.targetY)) {
self.setRandomTarget();
}
self.moveTo(self.targetX, self.targetY, self.speed);
};
self.hasReachedTarget = function (targetX, targetY) {
var dx = self.x - targetX;
var dy = self.y - targetY;
return Math.sqrt(dx * dx + dy * dy) < 5;
};
self.setRandomTarget = function () {
self.targetX = Math.random() * (2048 - self.width) + self.width / 2;
self.targetY = Math.random() * (2732 - self.height) + self.height / 2;
};
self.update = function () {
self.performBehavior();
};
});
var Granary = Container.expand(function () {
var self = Container.call(this);
self.granaryGraphics = self.createAsset('granary', 'Granary Graphics', 0.5, 0.5);
var positionInitializer = new PositionInitializer();
positionInitializer.initializeRandomPosition(self, self.granaryGraphics.width, self.granaryGraphics.height, function () {
return self.checkOverlapWithOtherBuildings();
});
self.storeFood = function (amount) {
self.gameResources.food.amount += amount;
if (self.gameResources.food.amount > 1000) self.gameResources.food.amount = 1000;
};
});
function globalSeekResource(villager, resourceType) {}
this.weatherSystem = new WeatherSystem();
Villager.prototype.performBehaviorBasedMovement = function () {
switch (this.state) {
case 'idle':
this.wanderRandomly();
break;
case 'goingHomeToRest':
this.moveTo(this.home.x, this.home.y, this.speed);
break;
case 'goingToWork':
this.moveTo(this.workplace.x, this.workplace.y, this.speed);
break;
case 'seekingFood':
case 'seekingWood':
case 'seekingRock':
this.seekResource(this.state.substring(7).toLowerCase());
break;
case 'trading':
this.moveTo(this.targetX, this.targetY, this.speed);
if (this.hasReachedTarget(this.targetX, this.targetY)) {
this.tradeWithMarketplace();
}
break;
default:
this.wanderRandomly();
break;
}
};
Villager.prototype.wanderRandomly = function () {
if (!this.targetX || !this.targetY || this.hasReachedTarget(this.targetX, this.targetY)) {
this.setRandomTarget();
}
this.moveTo(this.targetX, this.targetY, this.speed);
};
Villager.prototype.hasReachedTarget = function (targetX, targetY) {
var dx = this.x - targetX;
var dy = this.y - targetY;
return Math.sqrt(dx * dx + dy * dy) < 5;
};
Villager.prototype.tradeWithMarketplace = function () {
if (this.marketplace) {
var speechBubble = new Text2('Trading at marketplace...', {
size: 100,
fill: "#ffffff"
});
speechBubble.x = this.x;
speechBubble.y = this.y - 100;
this.addChild(speechBubble);
LK.setTimeout(function () {
speechBubble.destroy();
}, 3000);
this.marketplace.trade(this, 'wood', 10, 'food');
this.decideNextAction();
}
};
Villager.prototype.setRandomTarget = function () {
this.targetX = Math.random() * 2048;
this.targetY = Math.random() * 2732;
};
ResourceDisplay.prototype.positionDisplays = function () {
this.woodDisplay.position.set(100, 50);
this.rockDisplay.position.set(300, 50);
this.foodDisplay.position.set(500, 50);
};
Bakery.prototype.sellBread = function (villager) {
if (villager.gameResources.food.amount >= 5) {
villager.gameResources.food.amount -= 5;
villager.energy += 10;
if (villager.energy > 100) villager.energy = 100;
}
};
DayNightCycleManager.prototype.createTimeOfDayText = function () {
var text = new Text2('', {
size: 50,
fill: "#ffffff"
});
text.anchor.set(0.5, 0);
text.x = 2048 / 2;
text.y = 100;
return text;
};
var Game = Container.expand(function () {
var self = Container.call(this);
Game.prototype.createAndAddLumberjack = function () {
var lumberjack = new Lumberjack(this.resources, Math.random() * 50 + 50);
lumberjack.x = Math.random() * 2048;
lumberjack.y = Math.random() * 2732;
this.addChild(lumberjack);
this.villagers.push(lumberjack);
};
var villagerGraphics = LK.getAsset('villager', 'Villager Graphics', 0.5, 0.5);
var villager = self.addChild(villagerGraphics);
villager.x = 1024;
villager.y = 1366;
this.createBackground = function () {
var background = this.createAsset('background', 'Game Background', 0, 0);
background.width = 2048 * 1.5;
background.height = 2732 * 1.5;
background.anchor.set(0.5, 0.5);
background.x = 2048 / 2;
background.y = 2732 / 2;
this.addChildAt(background, 0);
};
this.createBackground();
Game.prototype.createAndAddVillager = function () {
var iq = Math.random() * 50 + 100;
var villager = new Villager(this.resources, iq);
this.addChildAt(villager, this.children.length - 1);
this.villagers.push(villager);
};
Game.prototype.executeCurrentAction = function (villager) {};
Game.prototype.registerVillager = function (villager) {
this.villagers.push(villager);
};
Game.prototype.createAndAddVillagerIfPossible = function () {
if (this.resources && this.resources.food.amount >= 10) {
this.createAndInitializeVillager(false, Math.random() * 50 + 50, Math.random() * 2048, Math.random() * 2732);
this.resources.food.amount -= 10;
}
};
Game.prototype.createAndInitializeVillager = function (isBaby, iq, x, y) {
var villager = this.villagerFactory.createVillager(iq);
villager.setAge(isBaby);
villager.x = x;
villager.y = y;
this.addChild(villager);
this.initializeVillagerProperties(villager);
this.villagers.push(villager);
};
Game.prototype.zoomOnVillagers = function (villagerA, villagerB) {
var zoomLevel = 2;
var centerX = (villagerA.x + villagerB.x) / 2;
var centerY = (villagerA.y + villagerB.y) / 2;
LK.stageContainer.scale.x = zoomLevel;
LK.stageContainer.scale.y = zoomLevel;
LK.stageContainer.pivot.x = centerX;
LK.stageContainer.pivot.y = centerY;
LK.stageContainer.x = LK.stageContainer.width / 2;
LK.stageContainer.y = LK.stageContainer.height / 2;
LK.setTimeout(function () {
LK.stageContainer.scale.x = 1;
LK.stageContainer.scale.y = 1;
LK.stageContainer.pivot.x = 0;
LK.stageContainer.pivot.y = 0;
LK.stageContainer.x = 0;
LK.stageContainer.y = 0;
}, 3000);
};
self.makeVillagerDecisions = function (villager) {
if (!villager.currentAction) {
if (typeof villager.decideNextAction === 'function') {
villager.decideNextAction();
}
}
};
LK.on('tick', function () {
if (self.villagerAndFramerateDisplay) self.framerateDisplay.update();
var currentTime = Date.now();
var elapsedTime = Math.floor((currentTime - self.startTime) / 1000);
self.timerText.setText('Time: ' + elapsedTime);
for (var i = 0; i < self.villagers.length; i++) {
var villager = self.villagers[i];
if (typeof villager.updateStateAndPosition === 'function') {
villager.updateStateAndPosition();
}
self.makeVillagerDecisions(villager);
}
self.handleVillagersFallingInLove();
});
self.timerText = new Text2('Time: 0', {
size: 100,
fill: "#ffffff"
});
self.timerText.anchor.set(1, 1);
self.timerText.x = 2048 - 500;
self.timerText.y = 2732;
LK.gui.topCenter.addChild(self.timerText);
self.startTime = Date.now();
var brewery = new Brewery();
self.addChild(brewery);
var newBrewery = new Brewery();
self.addChild(newBrewery);
var bakery = new Bakery();
self.addChild(bakery);
var newBakery = new Bakery();
self.addChild(newBakery);
var well = new Well();
self.addChild(well);
var newWell = new Well();
self.addChild(newWell);
self.resources = createResources();
self.resourceDisplay = new ResourceDisplay(self.resources);
LK.gui.topLeft.addChild(self.resourceDisplay);
Game.prototype.handleVillagersFallingInLove = function () {
for (var i = 0; i < this.villagers.length; i++) {
for (var j = i + 1; j < this.villagers.length; j++) {
var villagerA = this.villagers[i];
var villagerB = this.villagers[j];
}
}
};
function createResources() {
return {
wood: new Wood(100),
rock: new RockResource(100),
food: new FoodResource(100)
};
}
Villager.prototype.setAge = function (isBaby) {
if (isBaby) {
this.scale.x = 0.5;
this.scale.y = 0.5;
} else {
this.scale.x = 1;
this.scale.y = 1;
}
};
Game.prototype.addVillager = function (isBaby, iq, x, y) {
var villager = this.villagerFactory.initializeAndAddVillager(isBaby, iq, x, y);
this.initializeVillagerProperties(villager);
this.registerVillager(villager);
};
Game.prototype.initializeVillagerProperties = function (villager) {
villager.speed = 3;
villager.energy = 100;
villager.tiredness = 0;
villager.state = 'idle';
villager.home = null;
villager.workplace = null;
villager.currentAction = null;
villager.targetX = null;
villager.targetY = null;
};
this.villagers = [];
self.houses = [];
self.cloudLayer = new Container();
self.clouds = [];
self.villagerFactory = new VillagerFactory(self.resources);
['Miner', 'Fisherman', 'Guard', 'Farmer', 'Blacksmith', 'Merchant', 'Gardener'].forEach(function (villagerType) {
var count = 4;
for (var i = 0; i < count; i++) {
var iq = Math.random() * 50 + 50;
var x = 1024;
var y = 1366;
var villager = new Villager(self.resources, iq);
villager.x = x;
villager.y = y;
self.addChild(villager);
self.villagers.push(villager);
}
});
for (var i = 0; i < 2; i++) {
var iq = Math.random() * 50 + 50;
var x = 1024;
var y = 1366;
var villager = new Villager(self.resources, iq);
villager.x = x;
villager.y = y;
self.addChild(villager);
self.villagers.push(villager);
}
for (var i = 0; i < 4; i++) {
var iq = Math.random() * 50 + 50;
var home = new Home();
self.addChild(home);
var lumberjack = new Lumberjack(self.resources, iq);
lumberjack.x = home.x;
lumberjack.y = home.y;
self.addChild(lumberjack);
self.villagers.push(lumberjack);
}
for (var i = 0; i < 60; i++) {
var iq = Math.random() * 50 + 50;
var x = Math.random() * 2048;
var y = Math.random() * 2732;
var villager = this.villagerFactory.initializeAndAddVillager(false, iq, x, y);
this.initializeVillagerProperties(villager);
villager.speed /= 2;
this.registerVillager(villager);
}
self.market = new Marketplace();
self.addChild(self.market);
Game.prototype.createHouse = function (x, y) {
var house = new Home();
house.x = x;
house.y = y;
return house;
};
Game.prototype.addHouse = function (house) {
this.addChild(house);
this.houses.push(house);
};
var houses = [];
var newHouse = self.createHouse(2048 / 2, 2732 / 2);
self.addHouse(newHouse);
houses.push(newHouse);
Game.prototype.createWorkplace = function () {
var workplace = new EmployingWorkPlace();
workplace.x = Math.random() * 2048;
workplace.y = Math.random() * 2732;
return workplace;
};
Game.prototype.addWorkplace = function (workplace) {
this.addChild(workplace);
this.workplaces.push(workplace);
};
self.workplaces = [];
var workplace = self.createWorkplace();
self.addWorkplace(workplace);
self.workplaces.push(workplace);
var wood = new Wood();
wood.x = 2048 / 2;
wood.y = 2732 / 2 - 400;
self.addChild(wood);
var rock = new Rock();
rock.x = 2048 / 2 + 100;
rock.y = 2732 / 2 - 300;
self.addChild(rock);
var workplace = new EmployingWorkPlace();
workplace.x = Math.random() * 2048;
workplace.y = Math.random() * 2732;
self.workplaces.push(workplace);
self.addChild(workplace);
self.lumberjackCreationInterval = LK.setInterval(function () {
if (self.villagers.filter(function (v) {
return v instanceof Lumberjack;
}).length < 6) {
self.createAndAddLumberjack();
}
}, 3000);
var initialRock = new Rock();
initialRock.x = 1024;
initialRock.y = 1366;
self.addChild(initialRock);
var initialFood = new Food();
initialFood.x = 1024;
initialFood.y = 1566;
self.addChild(initialFood);
var villager1 = new Villager(self.resources, 100);
villager1.x = 500;
villager1.y = 500;
self.addChild(villager1);
self.villagers.push(villager1);
var villager2 = new Villager(self.resources, 100);
villager2.x = 600;
villager2.y = 600;
self.addChild(villager2);
self.villagers.push(villager2);
var home = new Home();
home.x = 700;
home.y = 700;
self.addChild(home);
var inn = new Inn();
inn.x = 900;
inn.y = 900;
self.addChild(inn);
var newInn = new Inn();
self.addChild(newInn);
var bakery = new Bakery();
bakery.x = 1000;
bakery.y = 1000;
self.addChild(bakery);
var well = new Well();
well.x = 1100;
well.y = 1100;
self.addChild(well);
var gardener = new Gardener();
gardener.x = 1200;
gardener.y = 1200;
self.addChild(gardener);
var festival = new Festival();
festival.x = 1300;
festival.y = 1300;
self.addChild(festival);
var house = new Home();
house.x = 1400;
house.y = 1400;
self.addChild(house);
var newHome = new Home();
self.addChild(newHome);
var employingWorkPlace = new EmployingWorkPlace();
employingWorkPlace.x = 1500;
employingWorkPlace.y = 1500;
self.addChild(employingWorkPlace);
var newEmployingWorkPlace = new EmployingWorkPlace();
self.addChild(newEmployingWorkPlace);
});
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.