Code edit (3 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: self.useBonus is not a function' in or related to this line: 'self.useBonus();' Line Number: 420
Code edit (1 edits merged)
Please save this source code
Code edit (2 edits merged)
Please save this source code
User prompt
ok, now update the rest of the DeliveryDrone class to use layers
User prompt
in DeliveryDrone, add a layer for packet assets and a layer for drone assets
User prompt
in drone prepare(), when attaching Asset packet1 put it as 1st child so it appears behind the drone
User prompt
in drone prepare(), attachAsset packet1 at z-index 0
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: drone is undefined' in or related to this line: 'drone._update_migrated();' Line Number: 1075
Code edit (5 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: self.detachAsset is not a function' in or related to this line: 'self.detachAsset('packet1');' Line Number: 499
User prompt
Please fix the bug: 'TypeError: self.detechAsset is not a function' in or related to this line: 'self.detechAsset('packet1');' Line Number: 499
Code edit (1 edits merged)
Please save this source code
Code edit (17 edits merged)
Please save this source code
User prompt
on tap on the DeliveryDrone, make the packet1 fall to the ground
Code edit (1 edits merged)
Please save this source code
User prompt
inside DeliveryDrone class, create 2 drone instances
User prompt
Create a class DeliveryDrone, put inside 2 drone instances and their visbility logic
Code edit (1 edits merged)
Please save this source code
User prompt
in menuHandling use ticks instead of setInterval
Code edit (3 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Timeout.tick error: game.getChildByName is not a function' in or related to this line: 'var drone = game.getChildByName('drone');' Line Number: 925
User prompt
in menuHandling, alternate visibility of the drones
Code edit (2 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -886,13 +886,25 @@
drone.x = 2048 - 300;
drone.y = 128; // Positioning the drone
game.addChild(drone);
var drone2 = new Drone(true); // false for odd drone graphic
- drone.x = 2048 - 300;
- drone.y = 128; // Positioning the drone
+ drone2.x = 2048 - 300;
+ drone2.y = 128; // Positioning the drone
+ drone2.visible = false; // Positioning the drone
game.addChild(drone2);
gameState = GAME_STATE.MENU;
}
+function menuHandling() {
+ // Alternate visibility of drones every 2 seconds
+ LK.setInterval(function () {
+ var drone = game.getChildByName('drone');
+ var drone2 = game.getChildByName('drone2');
+ if (drone && drone2) {
+ drone.visible = !drone.visible;
+ drone2.visible = !drone2.visible;
+ }
+ }, 2000);
+}
function cleanMenuState() {
game.removeChild(startText);
startText.destroy();
game.removeChild(startButton);
@@ -1274,9 +1286,9 @@
/****************************************************************************************** */
LK.on('tick', function () {
switch (gameState) {
case GAME_STATE.MENU:
- // Handle menu logic here
+ menuHandling();
break;
case GAME_STATE.STARTING:
hurdlesStarting();
break;
Elongated elipse with black top half and white bottom half.
full close and front view of empty stands. retro gaming style
delete
delete
Basquettes à ressort futuriste. vue de profile. Retro gaming style
a blue iron man style armor flying. Retro gaming style
a blue iron man style armor flying horizontally. Retro gaming style
round button with a big "up" arrow icon and a small line under it. UI
A big black horizontal arrow pointing left with centred text 'YOU' in capital letters, painted on an orange floor.. horizontal and pointing left
remove
gold athletics medal with ribbon. retro gaming style
a black oval with a crying smiley face.