/**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x000000 //Init game with black background });
===================================================================
--- original.js
+++ change.js
@@ -1,59 +1,6 @@
-/****
-* Classes
-****/
-// Assets are automatically created and loaded by the LK engine
-// Defense class
-var Defense = Container.expand(function () {
- var self = Container.call(this);
- var defenseGraphics = self.attachAsset('defense', {
- anchorX: 0.5,
- anchorY: 0.5
- });
- self.update = function () {
- // Defense logic goes here
- };
-});
-// Enemy class
-var Enemy = Container.expand(function () {
- var self = Container.call(this);
- var enemyGraphics = self.attachAsset('enemy', {
- anchorX: 0.5,
- anchorY: 0.5
- });
- self.update = function () {
- // Enemy logic goes here
- };
-});
-// Assets will be automatically created and loaded by the LK engine
-// Tower class
-var Tower = Container.expand(function () {
- var self = Container.call(this);
- var towerGraphics = self.attachAsset('tower', {
- anchorX: 0.5,
- anchorY: 0.5
- });
- self.update = function () {
- // Tower logic goes here
- };
-});
-
-/****
+/****
* Initialize Game
-****/
+****/
var game = new LK.Game({
backgroundColor: 0x000000 //Init game with black background
-});
-
-/****
-* Game Code
-****/
-// Initialize game variables
-var tower = game.addChild(new Tower());
-tower.x = 2048 / 2;
-tower.y = 2732 / 2;
-var enemies = [];
-var defenses = [];
-game.update = function () {
- // Game logic goes here
- // Spawn enemies, update defenses, check for collisions, etc.
-};
\ No newline at end of file
+});
\ No newline at end of file