User prompt
Reduce background size
User prompt
Double background size
User prompt
Center background
User prompt
Double background size
User prompt
Fix Bug: 'Uncaught TypeError: self.createBackground is not a function' in this line: 'self.createBackground();' Line Number: 377
User prompt
Create background
User prompt
Fix Bug: 'Uncaught TypeError: self.initializeWorkPlace is not a function' in this line: 'self.initializeWorkPlace();' Line Number: 270
User prompt
Fix all code
User prompt
Fix
User prompt
Fix Bug: 'Uncaught ReferenceError: Villager is not defined' in this line: 'Villager.prototype.isDoingSomething = function () {' Line Number: 287
User prompt
Fix
User prompt
Fix
User prompt
Fix Bug: 'Uncaught TypeError: villager.initializePosition is not a function' in this line: 'villager.initializePosition(x, y);' Line Number: 259
User prompt
Fix Bug: 'Uncaught TypeError: self.initializePosition is not a function' in this line: 'self.initializePosition();' Line Number: 68
User prompt
Fix
User prompt
Fix
User prompt
Improve 2 time
User prompt
Improve
User prompt
Improve
User prompt
Fix Bug: 'this.createAndAddVillager is not a function' in this line: 'this.createAndAddVillager(false, Math.random() * 50 + 50, Math.random() * 2048, Math.random() * 2732);' Line Number: 402
User prompt
Improve
User prompt
Improve
User prompt
Improve
User prompt
Fix Bug: 'Uncaught ReferenceError: Villager is not defined' in this line: 'Villager.prototype.isDoingSomething = function () {' Line Number: 270
User prompt
Fix
===================================================================
--- original.js
+++ change.js
@@ -285,9 +285,35 @@
this.y += dy / distance * moveDistance;
}
};
Villager.prototype.decideNextAction = function () {};
-Villager.prototype.update = function () {};
+Villager.prototype.performAction = function () {
+ switch (this.state) {
+ case 'idle':
+ break;
+ case 'goingHomeToRest':
+ this.moveTo(this.home.x, this.home.y, this.speed);
+ if (this.x === this.home.x && this.y === this.home.y) {
+ this.state = 'resting';
+ }
+ break;
+ case 'goingToWork':
+ this.moveTo(this.workplace.x, this.workplace.y, this.speed);
+ if (this.x === this.workplace.x && this.y === this.workplace.y) {
+ this.state = 'working';
+ }
+ break;
+ case 'wandering':
+ this.moveTo(this.targetX, this.targetY, this.speed);
+ if (this.x === this.targetX && this.y === this.targetY) {
+ this.decideNextAction();
+ }
+ break;
+ }
+};
+Villager.prototype.update = function () {
+ this.performAction();
+};
VillagerHome.prototype.initializeHome = function () {
this.homeGraphics = this.createAsset('house', 'Villager Home Graphics', .5, .5);
this.isOccupiable = true;
this.occupy = function (villager) {
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.