User prompt
Optimise talk
User prompt
Fix Bug: 'TypeError: this.resumeMovingAfterDelay is not a function' in this line: 'this.resumeMovingAfterDelay(5000);' Line Number: 454
User prompt
Fix Bug: 'TypeError: this.showSpeechBubble is not a function' in this line: 'this.showSpeechBubble('Hello!');' Line Number: 450
User prompt
Optimise talk
User prompt
Optimise talk
User prompt
Spawn a lumberjack every 3 second with a maximum of 6
User prompt
Create only two lumberjack at begining
User prompt
Spawn a max of 6 lumberjack
User prompt
Optimise lumberjack
User prompt
Spawn a lumberjack each 5 second
User prompt
Spawn a lumberjack each second
User prompt
Make all lumberjack start from a home
User prompt
Fix buble conversation text
User prompt
Make all lumberjack spawn at the center of the screen and double their number
User prompt
All lumberjack spawn at the center of the screen
User prompt
Add 5 time more lumberjack and reduce their speed 2 time
User prompt
Citizen cant walk outside of the screen
User prompt
Add 3 time more citizen and make them move 2 time slower
User prompt
Citizen stop walking for talking and restart walking after end of conversation. Conversation take 5 second
User prompt
Buble talk is bigger and cigizen talk mote
User prompt
Make lumberjack talk with to to each other and show a buble with a text each time
User prompt
Make movement base on behavior of each villager job
User prompt
Fix Bug: 'Uncaught ReferenceError: WoodResource is not defined' in this line: 'return {' Line Number: 1175
User prompt
Fix Bug: 'Uncaught ReferenceError: RockResource is not defined' in this line: 'self.collect = function (villager) {};' Line Number: 885
User prompt
Add 4 New functionality
===================================================================
--- original.js
+++ change.js
@@ -447,19 +447,25 @@
self.targetX = Math.random() * 2048;
self.targetY = Math.random() * 2732;
self.speed = 6;
self.move = function () {
+ if (!self.targetX || !self.targetY || self.hasReachedTarget(self.targetX, self.targetY)) {
+ self.setRandomTarget();
+ }
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;
- }
+ self.x += dx * self.speed;
+ self.y += dy * 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.targetY = Math.random() * 2732;
+ };
LK.on('tick', function () {
self.move();
var nearbyLumberjacks = self.parent.children.filter(function (child) {
return child !== self && child instanceof Lumberjack && self.intersects(child);
@@ -468,14 +474,12 @@
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();
- }
+ self.gameResources.wood.amount += self.choppingPower;
+ tree.amount -= self.choppingPower;
+ if (tree.amount <= 0) {
+ tree.destroy();
}
};
});
var Miner = Container.expand(function (resources) {
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.