User prompt
crea un clon de bottomUpgrade, que este 500 pixeles abajo, que se llame bottomCosmetic
User prompt
crea un clon de bottomUpgrade, que este 100 pixeles abajo, que se llame bottomCosmetic
Code edit (5 edits merged)
Please save this source code
User prompt
crea un clon de bottomUpgrade, que este paralelo del lado derecho, llamado bottomRock
Code edit (1 edits merged)
Please save this source code
User prompt
haz que metros deje de dar dinero
User prompt
haz que meterstext sea meters / 1000 y agregale "km"
User prompt
ajusta el espaciado entre moneytext y meters text para que esten más cerca
User prompt
ajusta el espaciado de los textos meters y money
User prompt
Position MeterText and MoneyText further down on the screen
User prompt
más abajo
User prompt
esquina superior izquierda de background
User prompt
no estan posicionados al centro
User prompt
ajusta para que se posicionen al top center del asset background
User prompt
acomoda meters and money text
User prompt
elimina todo lo relacionado con spin
User prompt
elimina cualquier restante de cosmetic
User prompt
elimina todo lo restante con cosmeticos
User prompt
elimina la mecanica de cosmeticos
User prompt
agrega un objeto llamado buttomUpgrade con el asset buttom en la mirad ingerior -> superior izquierda (foreground)
User prompt
elimina todo codigo relacionado con cosmetic
User prompt
Please fix the bug: 'CosmeticUseEnable3 is not defined' in or related to this line: 'cosmeticText3 = new Text2(CosmeticUseEnable3 ? 'Enabled' : 'Disabled', {' Line Number: 322
User prompt
Please fix the bug: 'CosmeticUseEnable2 is not defined' in or related to this line: 'var cosmeticText2 = new Text2(CosmeticUseEnable2 ? 'Enabled' : 'Disabled', {' Line Number: 302
User prompt
Please fix the bug: 'CosmeticUseEnable1 is not defined' in or related to this line: 'var cosmeticText1 = new Text2(CosmeticUseEnable1 ? 'Enabled' : 'Disabled', {' Line Number: 284
User prompt
Please fix the bug: 'CosmeticUseEnable0 is not defined' in or related to this line: 'cosmeticText0 = new Text2(CosmeticUseEnable0 ? 'Enabled' : 'Disabled', {' Line Number: 266
/**** * Plugins ****/ var storage = LK.import("@upit/storage.v1", { meters: 0, money: 0, spin: 0 }); /**** * Classes ****/ // Create a BackgroundContainer class var BackgroundContainer = Container.expand(function () { var self = Container.call(this); return self; }); // Create a ForegroundContainer class var ForegroundContainer = Container.expand(function () { var self = Container.call(this); return self; }); // Create a MidgroundContainer class var MidgroundContainer = Container.expand(function () { var self = Container.call(this); return self; }); // Create a Player class var Player = Container.expand(function () { var self = Container.call(this); // Create a list named 'rock' and add the 'Rock0' asset to it var rock = ['Rock0', 'Rock1', 'Rock2', 'Rock3', 'Rock4']; // Attach a shape asset to represent the player self.playerGraphics = self.attachAsset(rock[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; // Ensure player lands correctly jump = 2; // Reset jump count when player lands } // Add rotation to the player self.rotation += 0.05; // Play or pause rockmovement sound based on rock's position if (self.y < ground.y - self.height / 2 + 50) { LK.getSound('rockmovement').stop(); // Stop sound when rock is in the air self.lastWasOnGround = false; // Track if the rock was on the ground } else { if (!self.lastWasOnGround) { LK.getSound('rockFall').play(); // Play rockfall sound when rock lands LK.setTimeout(function () { LK.getSound('rockmovement').play({ loop: true }); // Play sound when rock is on the ground after rockfall }, 100); // Delay rockmovement sound by 100ms after rockfall } else { LK.getSound('rockmovement').play({ loop: true }); // Ensure rockmovement sound loops continuously } self.lastWasOnGround = true; // Update the state to indicate rock is on the ground } }; }); // 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: ' + spin); }; }); // 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 + 'm'); }; }); // 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 ****/ // Initialize BackgroundContainer, MidgroundContainer, and ForegroundContainer var game = new LK.Game({ backgroundColor: 0x000000 }); /**** * Game Code ****/ // Initialize BackgroundContainer, MidgroundContainer, and ForegroundContainer var backgroundContainer = new BackgroundContainer(); var midgroundContainer = new MidgroundContainer(); var foregroundContainer = new ForegroundContainer(); // Add containers to the game in the correct order game.addChild(backgroundContainer); game.addChild(midgroundContainer); game.addChild(foregroundContainer); // Add the 'bottom' asset to the foreground container var buttonUpgrade = LK.getAsset('button', { anchorX: 0.5, anchorY: 0.5, x: 100, // Position at the bottom left y: 2732 - 100 // Slightly above the bottom edge }); foregroundContainer.addChild(buttonUpgrade); var currentRockIndex = storage.currentRockIndex || 0; // Load saved background skin index or default to 0 var meters = storage.meters || 0; // Load saved meters or default to 0 var spin = storage.spin || 0; // Load saved spin or default to 0 var money = storage.money || 0; // Load saved money or default to 0 // Initialize a rock asset with a design var rock = LK.getAsset('Rock0', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2, y: 2732 / 2 }); backgroundContainer.addChild(rock); // Make the rock jump when the screen is touched game.down = function (x, y, obj) { if (jump > 0 && y < 2732 / 2 + 200) { LK.getSound('rockjump').play(); // Play rockjump sound when the rock jumps player.speed = -18; // Give an initial upward speed for the jump player.y -= 10; // Adjust position slightly to ensure jump effect player.update(); // Ensure the update method is called to apply the jump jump--; // Decrease jump count } }; // Create a background asset using the saved skin index var background = LK.getAsset('Background' + currentRockIndex, { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2, y: 2732 / 2 }); // Add the background to the game backgroundContainer.addChild(background); // Create a clone of the background asset var backgroundClone = LK.getAsset('Background' + currentRockIndex, { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2 + background.width, y: 2732 / 2 }); // Add the clone to the game backgroundContainer.addChild(backgroundClone); // Create a second clone of the background asset var backgroundClone2 = LK.getAsset('Background' + currentRockIndex, { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2 + 2 * background.width, y: 2732 / 2 }); // Add the second clone to the game backgroundContainer.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 midgroundContainer.addChild(ground); // Create a player instance and add it to the game var player = midgroundContainer.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' // Initialize a variable to track available jumps var jump = 2; // Initialize a variable to track 'giros' // Create a MeterText instance and add it to the game var meterText = foregroundContainer.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 = foregroundContainer.addChild(new MoneyText()); // Position MoneyText below the GirosText moneyText.x = 50; moneyText.y = 400; // Initialize a variable to track 'money' // Create a list named 'rock' and add all the 'rock<number>' assets to it // Ensure rock array is initialized with all rock assets var rock = ['Rock0', 'Rock1', 'Rock2', 'Rock3', 'Rock4', 'Rock5', 'Rock6', 'Rock7', 'Rock8', 'Rock9']; // Create a list named 'SkinSelect' var SkinSelect = []; var assets = LK.assets; if (assets) { for (var i = 0; i < assets.length; i++) { if (assets[i].id.startsWith('Rock')) { rock.push(assets[i].id); } } rock.sort(function (a, b) { return parseInt(a.replace('Rock', '')) - parseInt(b.replace('Rock', '')); }); } var girosText = foregroundContainer.addChild(new GirosText()); // Position GirosText below the MeterText, also a bit lower girosText.x = 50; girosText.y = 300; 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; // Log every time 250 meters are advanced if (meters % 250 === 0) { console.log('Advanced 250 meters'); // Play the 'HoundreMeters' sound every 250 meters LK.getSound('HoundreMeters').play(); money += 25; // Increase 'money' by 25 // Change background sprite currentRockIndex = (currentRockIndex + 1) % 8; // Cycle through 0 to 7 background.removeChild(background.playerGraphics); background.playerGraphics = background.attachAsset('Background' + currentRockIndex, { anchorX: 0.5, anchorY: 0.5 }); backgroundClone.removeChild(backgroundClone.playerGraphics); backgroundClone.playerGraphics = backgroundClone.attachAsset('Background' + currentRockIndex, { anchorX: 0.5, anchorY: 0.5 }); backgroundClone2.removeChild(backgroundClone2.playerGraphics); backgroundClone2.playerGraphics = backgroundClone2.attachAsset('Background' + currentRockIndex, { anchorX: 0.5, anchorY: 0.5 }); } // Play the 'HoundreMeters' sound at 250 meters if (meters === 250) { LK.getSound('HoundreMeters').play(); } } // Save progress every 1 second if (LK.ticks % 60 == 0) { storage.meters = meters; storage.money = money; storage.spin = spin; storage.currentRockIndex = currentRockIndex; // Save current background skin index } // Increment 'giros' every 2.09 seconds if (LK.ticks % Math.round(2.09 * 60) == 0) { spin += 1; } };
===================================================================
--- original.js
+++ change.js
@@ -122,8 +122,16 @@
game.addChild(backgroundContainer);
game.addChild(midgroundContainer);
game.addChild(foregroundContainer);
// Add the 'bottom' asset to the foreground container
+var buttonUpgrade = LK.getAsset('button', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 100,
+ // Position at the bottom left
+ y: 2732 - 100 // Slightly above the bottom edge
+});
+foregroundContainer.addChild(buttonUpgrade);
var currentRockIndex = storage.currentRockIndex || 0; // Load saved background skin index or default to 0
var meters = storage.meters || 0; // Load saved meters or default to 0
var spin = storage.spin || 0; // Load saved spin or default to 0
var money = storage.money || 0; // Load saved money or default to 0
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