User prompt
Fix Bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'expand')' in this line: 'var Doctor = Villager.expand(function (resources) {' Line Number: 47
User prompt
Add 3 new functionality
User prompt
Add 5 New functionality
User prompt
Lumberjack move base on their iq
User prompt
Lumberjack move 3 time faster
User prompt
Make lumberjack move
User prompt
Show villager
User prompt
Show villager
User prompt
Make villager upfront the background
User prompt
Add 8 new functionality
User prompt
Add 6 New functionality
User prompt
Fix villager
User prompt
Fix villager not spawning
User prompt
Improve all fonctionality
User prompt
Improve
User prompt
Fix Bug: 'Cannot read properties of undefined (reading 'villagers')' in this line: 'self.gameInstance.villagers.forEach(function (villager) {' Line Number: 8
User prompt
Improve the entire code in two pass
User prompt
Fix Bug: 'Cannot read properties of undefined (reading 'villagers')' in this line: 'self.gameInstance.villagers.forEach(function (villager) {' Line Number: 8
User prompt
Improve the entire code
User prompt
Fix Bug: 'TypeError: this.performAction is not a function' in this line: 'this.performAction();' Line Number: 852
User prompt
Fix Bug: 'TypeError: this.performAction is not a function' in this line: 'this.performAction();' Line Number: 852
User prompt
Fix Bug: 'TypeError: villager.decideNextAction is not a function' in this line: 'villager.decideNextAction();' Line Number: 995
User prompt
Fix Bug: 'TypeError: villager.decideNextAction is not a function' in this line: 'villager.decideNextAction();' Line Number: 995
User prompt
Fix Bug: 'TypeError: villager.updateStateAndPosition is not a function' in this line: 'villager.updateStateAndPosition();' Line Number: 1005
User prompt
Fix Bug: 'TypeError: villager.updateStateAndPosition is not a function' in this line: 'villager.updateStateAndPosition();' Line Number: 1005
===================================================================
--- original.js
+++ change.js
@@ -1,4 +1,65 @@
+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;
@@ -372,15 +433,14 @@
self.move = function () {
var dx = self.targetX - self.x;
var dy = self.targetY - self.y;
var distance = Math.sqrt(dx * dx + dy * dy);
- var iqFactor = self.iq / 100;
if (distance < 5) {
self.targetX = Math.random() * 2048;
self.targetY = Math.random() * 2732;
} else {
- self.x += dx / distance * self.speed * iqFactor;
- self.y += dy / distance * self.speed * iqFactor;
+ self.x += dx / distance * self.speed;
+ self.y += dy / distance * self.speed;
}
};
LK.on('tick', function () {
self.move();
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.