Code edit (13 edits merged)
Please save this source code
User prompt
joue canonSound quand on tape sur la machine
Code edit (4 edits merged)
Please save this source code
User prompt
déplace thirdGameCakePipe horizontalement en boucle entre 200 et 1848 ↪💡 Consider importing and using the following plugins: @upit/tween.v1
Code edit (4 edits merged)
Please save this source code
User prompt
crée une classe CakePipe mais ne l'utilise pas
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
User prompt
pour le minicacke du mini jeu 2 que le Nain crée devant la machine, ajoute en plus de l'animation de transparence, une animation de réduction de taille jusqu'à 0
User prompt
pour le minicacke du mini jeu 2 ajoute en plus de l'animation de transparence, une animation de réduction de taille jusqu'à 0
User prompt
quand on arrive dans le miniJeu 2 rend la machine inactive (flag active false) quand un Nain dépose un mini gateau devant la machine active la
Code edit (9 edits merged)
Please save this source code
User prompt
augmente la vitesse des nains du mini jeu 2
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'length')' in or related to this line: 'var miniCakeGraphics = self.attachAsset(originalCake.assetId, {' Line Number: 1189
User prompt
Ok, maintenant quand un Nain du mini-jeu 2 est en train d'attendre, creé un miniCake à sa position et anime-le vers le haut puis retire le ↪💡 Consider importing and using the following plugins: @upit/tween.v1
Code edit (2 edits merged)
Please save this source code
User prompt
ajoute un animation à lightUpperGraphics aussi comme centrale ↪💡 Consider importing and using the following plugins: @upit/tween.v1
Code edit (1 edits merged)
Please save this source code
Code edit (17 edits merged)
Please save this source code
User prompt
pour la lumiere centrale ajoute aussi une animation de rotation ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
l'animation des lumière de la machine doit etre faite en boucle ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Anime la CakeMachine en faisant changer la transparence des lumières en boucle ↪💡 Consider importing and using the following plugins: @upit/tween.v1
Code edit (3 edits merged)
Please save this source code
User prompt
ajoute lightCentral et lightSide à CakeMachine
===================================================================
--- original.js
+++ change.js
@@ -317,11 +317,44 @@
});
});
self.update = function () {
self.rotation += 0.1; // Rotate the bonus cake while it falls
+ // Vérifier la collision avec le thirdGameCakePipe en mode mini-jeu 2
+ if (isMiniGameRunning === 2) {
+ // Calculer les dimensions pour la détection de collision
+ var bonusCakeRadius = self.width / 2;
+ var pipeWidth = thirdGameCakePipe.width * 0.6;
+ var pipeHeight = thirdGameCakePipe.height * 0.9;
+ // Vérifier si le bonusCake est en collision avec le thirdGameCakePipe
+ var dx = Math.abs(self.x - thirdGameCakePipe.x);
+ var dy = Math.abs(self.y - thirdGameCakePipe.y);
+ if (dx < pipeWidth / 2 + bonusCakeRadius && dy < pipeHeight / 2 + bonusCakeRadius) {
+ // Collision détectée - aspirer le bonusCake vers le haut
+ self.speedY = -20; // Forte vitesse vers le haut
+ self.speedX = (thirdGameCakePipe.x - self.x) * 0.1;
+ self.gravity = 0; // Désactiver la gravité
+ // Jouer un son pour l'aspiration
+ LK.getSound('ohoh').play();
+ // Animation de rétrécissement
+ tween(self, {
+ scaleX: 0.5,
+ scaleY: 0.5
+ }, {
+ duration: 500,
+ easing: tween.easeOut
+ });
+ // Si le bonusCake atteint le haut de l'écran, le détruire
+ if (self.y < -bonusCakeRadius) {
+ self.destroy();
+ return;
+ }
+ }
+ }
+ // Comportement normal si pas de collision
self.y += self.speedY;
self.x += self.speedX;
self.speedY += self.gravity; // Apply gravity
+ // Détruire le bonusCake s'il sort de l'écran par le bas
if (self.y > 2732 + self.height / 2) {
self.destroy(); // Remove the bonus cake if it goes off-screen
}
};
@@ -367,8 +400,18 @@
});
lightCentralGraphics.x = -5;
lightCentralGraphics.y = 495;
self.addChild(lightCentralGraphics);
+ var bonusPreviewraphics = self.attachAsset('bonusCake', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ width: 80,
+ height: 70,
+ rotation: 0
+ });
+ bonusPreviewraphics.x = -3;
+ bonusPreviewraphics.y = -222;
+ self.addChild(bonusPreviewraphics);
var lightUpperGraphics = self.attachAsset('lightCentral', {
anchorX: 0.5,
anchorY: 0.5,
width: 100,
@@ -416,8 +459,27 @@
}
});
}
animateLightUpper();
+ // Animate lightUpperGraphics transparency and rotation
+ function animateBonusPreview() {
+ tween(bonusPreviewraphics, {
+ rotation: Math.PI * 2 // Full rotation
+ }, {
+ duration: 2000,
+ easing: tween.easeInOut,
+ onFinish: function onFinish() {
+ tween(bonusPreviewraphics, {
+ rotation: 0 // Reset rotation
+ }, {
+ duration: 1000,
+ easing: tween.easeInOut,
+ onFinish: animateBonusPreview // Restart the animation loop
+ });
+ }
+ });
+ }
+ animateBonusPreview();
var lightSideGraphics2 = self.attachAsset('lightSide', {
anchorX: 0.5,
anchorY: 0.5
});
@@ -492,8 +554,29 @@
}
});
}
animateLightSide2();
+ // Ajouter un gestionnaire d'événement pour le clic/tap sur la machine
+ self.on('down', function (x, y, obj) {
+ // Créer un bonusCake
+ var bonusCake = new BonusCake();
+ // Calculer la position initiale du bonusCake (à l'extrémité du canon)
+ var canonLength = 350; // Longueur approximative du canon
+ var canonEndX = self.x + self.canonCake.x + Math.sin(self.canonAngle) * canonLength;
+ var canonEndY = self.y + self.canonCake.y - Math.cos(self.canonAngle) * canonLength;
+ bonusCake.x = canonEndX;
+ bonusCake.y = canonEndY;
+ // Définir la vitesse initiale dans la direction du canon
+ var speed = 15;
+ bonusCake.speedX = Math.sin(self.canonAngle) * speed;
+ bonusCake.speedY = -Math.cos(self.canonAngle) * speed;
+ // Ajouter le bonusCake au conteneur approprié
+ if (isMiniGameRunning === 2) {
+ thirdGameMiddlegroundContainer.addChild(bonusCake);
+ }
+ // Jouer un son
+ LK.getSound('canonSound').play();
+ });
return self;
});
var CakePipe = Container.expand(function () {
var self = Container.call(this);
@@ -1943,38 +2026,8 @@
loop: true
});
isMiniGameRunning = 0;
storage.isMiniGameRunning = 0;
- /*
- // Restaurer l'état du jeu selon la valeur de storage.isMiniGameRunning
- LK.setTimeout(function () {
- // Récupérer l'état sauvegardé
- isMiniGameRunning = storage.isMiniGameRunning || 0;
- // Configurer les containers selon l'état sauvegardé
- if (isMiniGameRunning === 1) {
- // Si le joueur était dans le minijeu
- mainGameContainer.visible = false;
- mainGameContainer.y = 2732;
- miniGameContainer.visible = true;
- miniGameContainer.y = 0;
- thirdGameContainer.visible = false;
- } else if (isMiniGameRunning === 2) {
- // Si le joueur était dans le thirdGame
- mainGameContainer.visible = false;
- miniGameContainer.visible = false;
- miniGameContainer.x = -2048;
- thirdGameContainer.visible = true;
- thirdGameContainer.x = 0;
- thirdGameContainer.y = 0;
- } else {
- // Si le joueur était dans le jeu principal (ou valeur par défaut)
- mainGameContainer.visible = true;
- mainGameContainer.y = 0;
- miniGameContainer.visible = false;
- thirdGameContainer.visible = false;
- }
- }, 100);
- */
}
function initializeminiGameVariables() {
miniGameContainer = new Container();
miniGameContainer.x = 0;
@@ -2047,9 +2100,9 @@
thirdGameMiddlegroundContainer.addChild(thirdGameCakeMachine);
thirdGameCakeMachine.x = 1024;
thirdGameCakeMachine.y = 1600;
thirdGameCakePipe = new CakePipe();
- thirdGameMiddlegroundContainer.addChild(thirdGameCakePipe);
+ thirdGameForegroundContainer.addChild(thirdGameCakePipe);
thirdGameCakePipe.x = 512;
thirdGameCakePipe.y = 250;
// Create and start the ThirdDwarfManager
thirdDwarfManager = new ThirdDwarfManager();
a button saying 'reset'. In-Game asset. 2d. Blank background. High contrast.
enlève ça
interieure de patiserie. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
gâteau ( pas réaliste ). Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
sparkles
gâteau. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
gâteau. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
gâteau. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
dessin de toque de chef
étoile dorée toute simple comme dans les commentaires d'un site web
une patisserie (gâteau) simple. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
interieure de patiserie vide avec uniquement le sol et les murs. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
trace blanche verticale d'un effet de coup de ninja
Vue de face centrée d'une machine magique en forme de pièce montée arc-en-ciel avec une petite entrée d'alimentation en bas au milieu, un très grand hublot central et un tube transparent dirigé vers le haut.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
errorsond
Sound effect
relaxsond
Sound effect
clickSound
Sound effect
musiqueclicker
Music
buySound
Sound effect
resetSound
Sound effect
buyAutoclickerSound
Sound effect
clearedSound
Sound effect
bonusSound
Sound effect
ohoh
Sound effect
cheers
Sound effect
squashingSound
Sound effect
CutSound
Sound effect
youpi
Sound effect
canonSound
Sound effect
yeahh
Sound effect
nooo
Sound effect
machineError
Sound effect
aspire
Sound effect