===================================================================
--- original.js
+++ change.js
@@ -36,8 +36,16 @@
anchorX: 0.5,
anchorY: 0.5
});
});
+// Tree class
+var Tree = Container.expand(function () {
+ var self = Container.call(this);
+ var treeGraphics = self.attachAsset('tree', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+});
/****
* Initialize Game
****/
@@ -64,8 +72,13 @@
car = new Car();
car.x = 2048 / 2;
car.y = 2732 - 200;
game.addChild(car);
+ // Create tree
+ var tree = new Tree();
+ tree.x = 2048 / 2;
+ tree.y = 2732 - 400;
+ game.addChild(tree);
// Create score text
scoreTxt = new Text2('0', {
size: 150,
fill: "#ffffff"