Code edit (4 edits merged)
Please save this source code
User prompt
que su posición sea 600 pixeles del original
User prompt
haz un clon de item, de nombre "item1", a 200 pixeles de distancia del original
Code edit (1 edits merged)
Please save this source code
User prompt
mueve la posición de "item" 300 pixeles
User prompt
mueve la posición x de item a 200
User prompt
mueve item a la
User prompt
desabilita la opción que al hacer click cambie la skin
User prompt
no se muestra item
User prompt
Vuelve a colocar en la escena el objeto "item"
User prompt
Elimina el asset "menubox" y todo el codigo relacionado a este
User prompt
Please fix the bug: 'menuBox is not defined' in or related to this line: 'var itemAsset = LK.getAsset('Item', {' Line Number: 167
User prompt
elimina menubox
User prompt
Please fix the bug: 'Cannot read properties of undefined (reading 'x')' in or related to this line: 'var itemAsset = LK.getAsset('Item', {' Line Number: 167
User prompt
Coloca "item" por encima de "menubox" y que este ubicado en la izquierda arriba de este
Code edit (1 edits merged)
Please save this source code
User prompt
agrega a la escena el asset iten y agregalo a la lista skinselect
User prompt
Crea una lista llamada SkinSelect
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'length')' in or related to this line: 'player.playerGraphics = player.attachAsset(skin[currentSkinIndex], {' Line Number: 98
User prompt
Please fix the bug: 'Uncaught ReferenceError: playerGraphics is not defined' in or related to this line: 'player.removeChild(playerGraphics);' Line Number: 97
User prompt
haz que al tocar la pantalla la skin de la roca cambie entre skin0 a skin4
User prompt
Please fix the bug: 'Uncaught TypeError: player.playerGraphics.setImage is not a function' in or related to this line: 'player.playerGraphics.setImage(skin[currentSkinIndex]);' Line Number: 98
User prompt
Please fix the bug: 'Uncaught TypeError: player.playerGraphics.setTexture is not a function' in or related to this line: 'player.playerGraphics.setTexture(skin[currentSkinIndex]);' Line Number: 98
User prompt
Please fix the bug: 'Uncaught ReferenceError: playerGraphics is not defined' in or related to this line: 'playerGraphics.setTexture(skin[currentSkinIndex]);' Line Number: 98
User prompt
haz que al clickear la pantalla el jugador cambie de skin
/**** * Classes ****/ // Create a Player class var Player = Container.expand(function () { var self = Container.call(this); // Create a list named 'skin' and add the 'Skin0' asset to it var skin = ['Skin0']; // Attach a shape asset to represent the player self.playerGraphics = self.attachAsset(skin[0], { anchorX: 0.5, anchorY: 0.5 }); // Set player speed self.speed = 5; // This is automatically called every game tick, if the player is attached! self.update = function () { self.y += self.speed; // Add gravity to the player if (self.y < ground.y - self.height / 2 + 50) { self.speed += 0.5; } else { self.speed = 0; self.y = ground.y - self.height / 2 + 50; } // Add rotation to the player self.rotation += 0.05; // Play rockmovement sound in loop LK.getSound('rockmovement').play({ loop: true }); }; }); // Create a GirosText class to display the number of 'giros' var GirosText = Text2.expand(function () { var self = Text2.call(this, '0', { size: 100, fill: 0xFFFFFF }); self.update = function () { self.setText('Spins: ' + giros); }; }); // Create a GirosText instance and add it to the game // Create a Text class to display the meters covered var MeterText = Text2.expand(function () { var self = Text2.call(this, '0', { size: 100, fill: 0xFFFFFF }); self.update = function () { self.setText('Meters: ' + meters); }; }); // Create a MoneyText class to display the amount of 'money' var MoneyText = Text2.expand(function () { var self = Text2.call(this, '0', { size: 100, fill: 0xFFFFFF }); self.update = function () { self.setText('Money: ' + money); }; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x000000 }); /**** * Game Code ****/ // Create a background asset // Initialize a player asset var currentSkinIndex = 0; // Track the current skin index game.down = function (x, y, obj) { // Change to the next skin currentSkinIndex = (currentSkinIndex + 1) % skin.length; player.playerGraphics.setImage(skin[currentSkinIndex]); }; var background = LK.getAsset('background', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2, y: 2732 / 2 }); // Add the background to the game game.addChild(background); // Create a clone of the background asset var backgroundClone = LK.getAsset('background', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2 + background.width, y: 2732 / 2 }); // Add the clone to the game game.addChild(backgroundClone); // Create a second clone of the background asset var backgroundClone2 = LK.getAsset('background', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2 + 2 * background.width, y: 2732 / 2 }); // Add the second clone to the game game.addChild(backgroundClone2); // Initialize a ground asset var ground = LK.getAsset('ground', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2, y: 2732 / 2, width: background.width, alpha: 0 }); // Add the ground to the game game.addChild(ground); // Create a player instance and add it to the game var player = game.addChild(new Player()); // Position player more towards the center of the screen player.x = 2048 / 4; player.y = 2732 / 2 + 10; // Initialize a variable to track 'meters' var meters = 0; // Initialize a variable to track 'giros' var giros = 0; // Create a MeterText instance and add it to the game var meterText = game.addChild(new MeterText()); // Position MeterText at the top left of the screen, a bit lower meterText.x = 50; meterText.y = 200; // Create a GirosText instance and add it to the game var moneyText = game.addChild(new MoneyText()); // Position MoneyText below the GirosText moneyText.x = 50; moneyText.y = 400; // Initialize a variable to track 'money' var money = 0; // Create a list named 'skin' and add all the 'skin<number>' assets to it var skin = []; var assets = LK.assets; if (assets) { for (var i = 0; i < assets.length; i++) { if (assets[i].id.startsWith('Skin')) { skin.push(assets[i].id); } } skin.sort(function (a, b) { return parseInt(a.replace('Skin', '')) - parseInt(b.replace('Skin', '')); }); } var girosText = game.addChild(new GirosText()); // Position GirosText below the MeterText, also a bit lower girosText.x = 50; girosText.y = 300; // Create a menuBox instance and add it to the game var menuBox = LK.getAsset('menuBox', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2, y: 2735 * 0.8, // Lower the menu box a bit width: 2048, height: 2732 / 2.8 }); game.addChild(menuBox); game.update = function () { background.x -= 5; backgroundClone.x -= 5; backgroundClone2.x -= 5; if (background.x + background.width < 0) { background.x = backgroundClone2.x + background.width; } if (backgroundClone.x + backgroundClone.width < 0) { backgroundClone.x = background.x + background.width; } if (backgroundClone2.x + backgroundClone2.width < 0) { backgroundClone2.x = backgroundClone.x + backgroundClone.width; } // Increment 'meters' every second if (LK.ticks % 60 == 0) { meters += 1; // Play the 'HoundreMeters' sound every 100 meters if (meters % 100 == 0) { LK.getSound('HoundreMeters').play(); } } // Increment 'giros' every 2.09 seconds if (LK.ticks % Math.round(2.09 * 60) == 0) { giros += 1; } };
===================================================================
--- original.js
+++ change.js
@@ -78,9 +78,9 @@
var currentSkinIndex = 0; // Track the current skin index
game.down = function (x, y, obj) {
// Change to the next skin
currentSkinIndex = (currentSkinIndex + 1) % skin.length;
- player.playerGraphics.setTexture(skin[currentSkinIndex]);
+ player.playerGraphics.setImage(skin[currentSkinIndex]);
};
var background = LK.getAsset('background', {
anchorX: 0.5,
anchorY: 0.5,
que no contenga sombras ni luces
una cabeza de moai redonda. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
Una esfera de hierro. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
Una esfera de oro. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
una piedra redonda musgosa. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
la bandera de argentina redonda. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
moneda de cobre. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
moneda de silver. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
moneda de gold. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
diamante Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
Una rueda de carretilla medieval. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
pelota de basquetbal modelo Molten. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
pelota de futbol hecha de hielo. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
Bola disco. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
Una bola de voley de planta. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
Una bola de pinchos. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
Una bola de lana. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
Agrega una esfera que dentro contenga un cielo. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
Una esfera con la via láctea. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
proporción 1000-2000, marios más robustos y sin tanto relieve
Un papel medieval con una enorme flecha hacia la izquierda de pintura en medio. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
Esfera del dragon. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
Esfera demoniaca. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
Esfera de hada. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
una manzana redonda. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
Un capiraba redondo como una pelota. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
Un armadillo hecho bolita. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
Una estrella redondita. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
Mejorar el diseños de lás casas para que sean más medievales y aumentar su calidad, más arboles y mejorar la calidad del cesped