User prompt
make background0 for page0 not background1 in page0
User prompt
Please fix the bug: 'Uncaught ReferenceError: background1 is not defined' in or related to this line: 'self.offset = {' Line Number: 77
User prompt
Make each gate can go to a page like gate1 to page1 so on
User prompt
check the pages if they are in game page1 2 3 4 5 6
User prompt
Add background6 to page6
User prompt
Start the game from page0
User prompt
Remove background6 from page0!
User prompt
Add page6 to the game and its background6 asset
User prompt
change name of background2 3 4 5 6 to be background1 2 3 4 5
User prompt
change the name of Backgrounds to be background0 1 2 3 4 5
User prompt
Anything with level make it page
User prompt
Don't let the levels levels change there original text to page
User prompt
change level1 2 3 4 5 6 to pages but make the level1 page0 level2 page1 level3 page2 so on
Code edit (3 edits merged)
Please save this source code
User prompt
Make it move with drage of background1.
User prompt
Add gate6 to the page1
User prompt
change levels to be pages
Code edit (1 edits merged)
Please save this source code
User prompt
Make the gate5 move with the drag of background1.
User prompt
Add gate5 to level1
Code edit (3 edits merged)
Please save this source code
User prompt
Make gate4 move with background1
User prompt
Add gate4 to level1
Code edit (14 edits merged)
Please save this source code
User prompt
Make gate3 move with background1 when dragging its image.
/**** * Classes ****/ var Page1 = Container.expand(function () { var self = Container.call(this); // Get and automatically addChild to self asset with id 'background1' with the anchor point set to 0, 0 var background1 = self.attachAsset('background1', { anchorX: 0.5, anchorY: 0.5, x: 1024, y: 1366, scaleX: 1.5, scaleY: 1.5 }); // Add drag functionality to the background1 image self.down = function (x, y, obj) { self.dragging = true; self.data = obj.data; self.initialClick = { x: x, y: y }; self.offset = { x: background1.x - x, y: background1.y - y }; }; self.up = function () { self.dragging = false; self.data = null; }; self.move = function (x, y, obj) { if (self.dragging) { var dx = x - self.initialClick.x; var dy = y - self.initialClick.y; background1.x = x + self.offset.x; background1.y = y + self.offset.y; gate1.x = background1.x; // Sync gate1's x position with background1 gate1.y = background1.y; // Sync gate1's y position with background1 gate2.x = background1.x; // Sync gate2's x position with background1 gate2.y = background1.y; // Sync gate2's y position with background1 gate3.x = background1.x; // Sync gate3's x position with background1 gate3.y = background1.y; // Sync gate3's y position with background1 gate4.x = background1.x; // Sync gate4's x position with background1 gate4.y = background1.y; // Sync gate4's y position with background1 gate5.x = background1.x; // Sync gate5's x position with background1 gate5.y = background1.y; // Sync gate5's y position with background1 self.initialClick = { x: x, y: y }; } }; // Get and automatically addChild to self asset with id 'gate1' with the anchor point set to 0.5, 0.5 var gate1 = self.attachAsset('gate1', { anchorX: 9.5, anchorY: 1.4, x: 1024, y: 1366 }); // Get and automatically addChild to self asset with id 'gate2' with the anchor point set to 0.5, 0.5 var gate2 = self.attachAsset('gate2', { anchorX: 5.5, anchorY: 0.8, x: 1024, y: 1366 }); // Get and automatically addChild to self asset with id 'gate3' with the anchor point set to 0.5, 0.5 var gate3 = self.attachAsset('gate3', { anchorX: 2.4, anchorY: -3.5, x: 1024, y: 1366 }); // Get and automatically addChild to self asset with id 'gate4' with the anchor point set to 0.5, 0.5 var gate4 = self.attachAsset('gate4', { anchorX: 9.8, anchorY: 9.8, x: 1024, y: 1366 }); gate4.x = background1.x; // Sync gate4's x position with background1 gate4.y = background1.y; // Sync gate4's y position with background1 // Get and automatically addChild to self asset with id 'gate5' with the anchor point set to 0.5, 0.5 var gate5 = self.attachAsset('gate5', { anchorX: 3, anchorY: 7, x: 1024, y: 1366 }); gate5.x = background1.x; // Sync gate5's x position with background1 gate5.y = background1.y; // Sync gate5's y position with background1 }); // Create a Level2 class by using the LK expand method to extend Container. var Page2 = Container.expand(function () { var self = Container.call(this); // Get and automatically addChild to self asset with id 'background2' with the anchor point set to 0, 0 var background2 = self.attachAsset('background2', { anchorX: 0.0, anchorY: 0.0, x: 0, y: 0 }); }); var Page3 = Container.expand(function () { var self = Container.call(this); // Get and automatically addChild to self asset with id 'background3' with the anchor point set to 0, 0 var background3 = self.attachAsset('background3', { anchorX: 0.0, anchorY: 0.0, x: 0, y: 0 }); }); var Page4 = Container.expand(function () { var self = Container.call(this); // Get and automatically addChild to self asset with id 'background4' with the anchor point set to 0, 0 var background4 = self.attachAsset('background4', { anchorX: 0.0, anchorY: 0.0, x: 0, y: 0 }); }); var Page5 = Container.expand(function () { var self = Container.call(this); // Get and automatically addChild to self asset with id 'background5' with the anchor point set to 0, 0 var background5 = self.attachAsset('background5', { anchorX: 0.0, anchorY: 0.0, x: 0, y: 0 }); }); // Create a Level6 class by using the LK expand method to extend Container. var Page6 = Container.expand(function () { var self = Container.call(this); // Get and automatically addChild to self asset with id 'background6' with the anchor point set to 0, 0 var background6 = self.attachAsset('background6', { anchorX: 0.0, anchorY: 0.0, x: 0, y: 0 }); }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x000000 }); /**** * Game Code ****/ //{0.1} //{0.2} //{0.3} //{0.4} //{0.5} //{0.6} //{0.7} //{0.8} //{0.9} //{0.a} //{0.b} var page = game.addChild(new Page1()); ; //{0.b}
===================================================================
--- original.js
+++ change.js
@@ -1,8 +1,8 @@
/****
* Classes
****/
-var Level1 = Container.expand(function () {
+var Page1 = Container.expand(function () {
var self = Container.call(this);
// Get and automatically addChild to self asset with id 'background1' with the anchor point set to 0, 0
var background1 = self.attachAsset('background1', {
anchorX: 0.5,
@@ -82,18 +82,18 @@
gate4.x = background1.x; // Sync gate4's x position with background1
gate4.y = background1.y; // Sync gate4's y position with background1
// Get and automatically addChild to self asset with id 'gate5' with the anchor point set to 0.5, 0.5
var gate5 = self.attachAsset('gate5', {
- anchorX: 1.5,
- anchorY: 6,
+ anchorX: 3,
+ anchorY: 7,
x: 1024,
y: 1366
});
gate5.x = background1.x; // Sync gate5's x position with background1
gate5.y = background1.y; // Sync gate5's y position with background1
});
// Create a Level2 class by using the LK expand method to extend Container.
-var Level2 = Container.expand(function () {
+var Page2 = Container.expand(function () {
var self = Container.call(this);
// Get and automatically addChild to self asset with id 'background2' with the anchor point set to 0, 0
var background2 = self.attachAsset('background2', {
anchorX: 0.0,
@@ -101,9 +101,9 @@
x: 0,
y: 0
});
});
-var Level3 = Container.expand(function () {
+var Page3 = Container.expand(function () {
var self = Container.call(this);
// Get and automatically addChild to self asset with id 'background3' with the anchor point set to 0, 0
var background3 = self.attachAsset('background3', {
anchorX: 0.0,
@@ -111,9 +111,9 @@
x: 0,
y: 0
});
});
-var Level4 = Container.expand(function () {
+var Page4 = Container.expand(function () {
var self = Container.call(this);
// Get and automatically addChild to self asset with id 'background4' with the anchor point set to 0, 0
var background4 = self.attachAsset('background4', {
anchorX: 0.0,
@@ -121,9 +121,9 @@
x: 0,
y: 0
});
});
-var Level5 = Container.expand(function () {
+var Page5 = Container.expand(function () {
var self = Container.call(this);
// Get and automatically addChild to self asset with id 'background5' with the anchor point set to 0, 0
var background5 = self.attachAsset('background5', {
anchorX: 0.0,
@@ -132,9 +132,9 @@
y: 0
});
});
// Create a Level6 class by using the LK expand method to extend Container.
-var Level6 = Container.expand(function () {
+var Page6 = Container.expand(function () {
var self = Container.call(this);
// Get and automatically addChild to self asset with id 'background6' with the anchor point set to 0, 0
var background6 = self.attachAsset('background6', {
anchorX: 0.0,
@@ -164,5 +164,6 @@
//{0.8}
//{0.9}
//{0.a}
//{0.b}
-var level = game.addChild(new Level1());
\ No newline at end of file
+var page = game.addChild(new Page1());
+; //{0.b}
\ No newline at end of file
2D wreckage of wood, square, HD colors. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
House from the front facing the screen with big sign above it have description "SHOP", Hd colors
coin, have "AD" not "$", hd colors. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows