User prompt
Fix Bug: 'Uncaught TypeError: this.well.createAsset is not a function' in this line: 'this.wellGraphics = this.well.createAsset('well', 'Well Graphics', .5, .5);' Line Number: 299
User prompt
Improve
User prompt
Fix Bug: 'Uncaught ReferenceError: House is not defined' in this line: 'var house = new House();' Line Number: 489
User prompt
Improve
User prompt
Improve
User prompt
Fix Bug: 'Uncaught TypeError: Cannot read properties of null (reading 'addChild')' in this line: 'self.parent.addChild(villager);' Line Number: 273
User prompt
Fix Bug: 'Uncaught TypeError: Cannot read properties of null (reading 'addChild')' in this line: 'self.parent.addChild(villager);' Line Number: 273
User prompt
Fix Bug: 'Uncaught TypeError: Cannot read properties of null (reading 'addChild')' in this line: 'self.parent.addChild(villager);' Line Number: 271
User prompt
Improve
User prompt
Improve
User prompt
Improve the code
User prompt
Fix Bug: 'Uncaught ReferenceError: houses is not defined' in this line: 'houses.push(house);' Line Number: 475
User prompt
Fix Bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'houses')' in this line: 'this.self.houses.push(house);' Line Number: 445
User prompt
Fix Bug: 'Uncaught ReferenceError: houses is not defined' in this line: 'houses.push(house);' Line Number: 475
User prompt
Fix Bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'houses')' in this line: 'this.self.houses.push(house);' Line Number: 445
User prompt
Fix Bug: 'Uncaught ReferenceError: houses is not defined' in this line: 'houses.push(house);' Line Number: 475
User prompt
Fix Bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'houses')' in this line: 'this.self.houses.push(house);' Line Number: 445
User prompt
Fix Bug: 'Uncaught ReferenceError: houses is not defined' in this line: 'houses.push(house);' Line Number: 475
User prompt
Fix Bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'houses')' in this line: 'this.self.houses.push(house);' Line Number: 445
User prompt
Fix Bug: 'Uncaught ReferenceError: houses is not defined' in this line: 'houses.push(house);' Line Number: 475
User prompt
Fix Bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'houses')' in this line: 'this.self.houses.push(house);' Line Number: 445
User prompt
Fix Bug: 'Uncaught ReferenceError: houses is not defined' in this line: 'houses.push(house);' Line Number: 475
User prompt
Fix Bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'houses')' in this line: 'this.self.houses.push(house);' Line Number: 445
User prompt
Fix Bug: 'Uncaught ReferenceError: houses is not defined' in this line: 'houses.push(house);' Line Number: 475
User prompt
Fix Bug: 'Uncaught TypeError: self.initializeHouses is not a function' in this line: 'self.initializeHouses();' Line Number: 447
===================================================================
--- original.js
+++ change.js
@@ -1,27 +1,57 @@
var ResourceDisplay = Container.expand(function (resources) {
var self = Container.call(this);
- self.woodDisplay = new WoodDisplay(resources.wood);
- self.rockDisplay = new RockDisplay(resources.rock);
- self.foodDisplay = new FoodDisplay(resources.food);
- self.addChild(self.woodDisplay);
- self.addChild(self.rockDisplay);
- self.addChild(self.foodDisplay);
+ 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.woodDisplay.x = 100;
+ self.woodDisplay.y = 50;
+ self.rockDisplay.x = 300;
+ self.rockDisplay.y = 50;
+ self.foodDisplay.x = 500;
+ self.foodDisplay.y = 50;
});
var Romance = Container.expand(function () {
var self = Container.call(this);
});
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);
+ var woodText = new Text2(woodResource.amount.toString(), {
+ size: 50,
+ fill: "#ffffff"
+ });
+ woodText.x = woodGraphics.width / 2;
+ woodText.y = woodGraphics.height + 20;
+ self.addChild(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);
+ var rockText = new Text2(rockResource.amount.toString(), {
+ size: 50,
+ fill: "#ffffff"
+ });
+ rockText.x = rockGraphics.width / 2;
+ rockText.y = rockGraphics.height + 20;
+ self.addChild(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);
+ var foodText = new Text2(foodResource.amount.toString(), {
+ size: 50,
+ fill: "#ffffff"
+ });
+ foodText.x = foodGraphics.width / 2;
+ foodText.y = foodGraphics.height + 20;
+ self.addChild(foodText);
});
var Well = Container.expand(function () {
var self = Container.call(this);
self.initialize();
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.