/**** 
* Classes
****/ 
// Enemy class
var Enemy = Container.expand(function () {
	var self = Container.call(this);
	var enemyGraphics = self.attachAsset('enemy', {
		anchorX: 0.5,
		anchorY: 0.5
	});
	self.speed = 5;
	self.update = function () {
		self.y += self.speed;
		if (self.y > 2732) {
			self.destroy();
			enemies.splice(enemies.indexOf(self), 1);
		}
	};
});
//<Assets used in the game will automatically appear here>
// Hero class
var Hero = Container.expand(function () {
	var self = Container.call(this);
	var heroGraphics = self.attachAsset('hero', {
		anchorX: 0.5,
		anchorY: 0.5
	});
	self.speed = 10;
	self.update = function () {
		// Update logic for hero
	};
	self.shoot = function () {
		var bullet = new HeroBullet();
		bullet.x = self.x;
		bullet.y = self.y - heroGraphics.height / 2;
		game.addChild(bullet);
		heroBullets.push(bullet);
	};
});
// HeroBullet class
var HeroBullet = Container.expand(function () {
	var self = Container.call(this);
	var bulletGraphics = self.attachAsset('heroBullet', {
		anchorX: 0.5,
		anchorY: 0.5
	});
	self.speed = -15;
	self.update = function () {
		self.y += self.speed;
		if (self.y < 0) {
			self.destroy();
			heroBullets.splice(heroBullets.indexOf(self), 1);
		}
	};
});
/**** 
* Initialize Game
****/ 
var game = new LK.Game({
	backgroundColor: 0x000000 //Init game with black background 
});
/**** 
* Game Code
****/ 
var hero;
var enemies = [];
var heroBullets = [];
var score = 0;
var scoreTxt;
// Initialize hero
hero = new Hero();
hero.x = 2048 / 2;
hero.y = 2732 - 200;
game.addChild(hero);
// Initialize score text
scoreTxt = new Text2('0', {
	size: 150,
	fill: "#ffffff"
});
scoreTxt.anchor.set(0.5, 0);
LK.gui.top.addChild(scoreTxt);
// Spawn enemies at intervals
var enemySpawnInterval = LK.setInterval(function () {
	var enemy = new Enemy();
	enemy.x = Math.random() * 2048;
	enemy.y = -100;
	game.addChild(enemy);
	enemies.push(enemy);
}, 1000);
// Handle game updates
game.update = function () {
	// Update hero
	if (LK.isTouching) {
		var touchPos = game.toLocal(LK.touch.global);
		hero.x = touchPos.x;
		hero.y = touchPos.y;
	}
	hero.update();
	// Update enemies
	for (var i = enemies.length - 1; i >= 0; i--) {
		enemies[i].update();
	}
	// Update hero bullets
	for (var j = heroBullets.length - 1; j >= 0; j--) {
		heroBullets[j].update();
	}
	// Check for collisions
	for (var k = enemies.length - 1; k >= 0; k--) {
		for (var l = heroBullets.length - 1; l >= 0; l--) {
			if (enemies[k].intersects(heroBullets[l])) {
				enemies[k].destroy();
				heroBullets[l].destroy();
				enemies.splice(k, 1);
				heroBullets.splice(l, 1);
				score++;
				scoreTxt.setText(score);
				break;
			}
		}
	}
};
// Handle touch events for shooting
game.down = function (x, y, obj) {
	hero.shoot();
	hero.x = x;
	hero.y = y;
};
game.move = function (x, y, obj) {
	hero.x = x;
	hero.y = y;
}; ===================================================================
--- original.js
+++ change.js
@@ -123,7 +123,11 @@
 };
 // Handle touch events for shooting
 game.down = function (x, y, obj) {
 	hero.shoot();
-	// hero.x = x;
-	// hero.y = y;
+	hero.x = x;
+	hero.y = y;
+};
+game.move = function (x, y, obj) {
+	hero.x = x;
+	hero.y = y;
 };
\ No newline at end of file