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
Code edit (1 edits merged)
Please save this source code
Code edit (10 edits merged)
Please save this source code
User prompt
stop le CakeRainManager quand on est pas en mode mini jeu 1
Code edit (1 edits merged)
Please save this source code
User prompt
dans toggleMiniGame; ajoute un flag pour empêcher un autre appel à toggleMiniGame tant que les animations de transition ne sont pas terminées
Code edit (1 edits merged)
Please save this source code
Code edit (10 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Cannot read properties of undefined (reading 'width')' in or related to this line: 'switchButtonMini.x = switchButtonThird.width * 0.5;' Line Number: 1736
Code edit (1 edits merged)
Please save this source code
Code edit (16 edits merged)
Please save this source code
User prompt
permet la découpe des gateaux 'confetti' dans le jeu principal sans altérer le mini-jeu. Reprend les memes éléments : - ajouter un CutEffect - crééer 2 minicakes
User prompt
permet la découpe des gateaux 'confetti' dans le jeu principal sans altérer le mini-jeu
User prompt
Change le nombre de nains à 20
User prompt
Joue le son youpi quand un nain attrape un minicake
User prompt
Le squashingSound doit être joué dés le début du squashing anim, pas à la fin
User prompt
Joue cut sound quand un gâteau est coupé en miniCakes
User prompt
Joue squashing sound quand un nain se fait écraser
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -532,9 +532,9 @@
self.idleTime = 0; // Compteur pour le temps d'inactivité
self.maxIdleTime = 30; // Temps maximum d'inactivité avant de chercher activement une cible
// Update function for movement and animation
self.update = function () {
- if (!isMiniGameRunning || self.isSquashing) {
+ if (isMiniGameRunning !== 1 || self.isSquashing) {
return;
} // Only update if the mini-game is active and not being squashed
// Check if the dwarf reaches x = -300 and switch mode from full to empty
if (self.x <= -300 && self.state === 'full') {
@@ -1455,13 +1455,14 @@
if (isMiniGameRunning === 0) {
// Passage du jeu principal au minijeu (slide vers le bas)
isMiniGameRunning = 1;
storage.isMiniGameRunning = 1; // Update storage
- miniGameContainer.y = -2732; // Positionner au-dessus pour l'animation
+ miniGameContainer.x = 0;
+ miniGameContainer.y = 2732; // Positionner au-dessus pour l'animation
miniGameContainer.visible = true;
// Animation du jeu principal vers le bas
tween(mainGameContainer, {
- y: 2732
+ y: -2732
}, {
duration: 1000,
easing: tween.easeInOut,
onFinish: function onFinish() {
@@ -1476,12 +1477,12 @@
easing: tween.easeInOut
});
} else if (isMiniGameRunning === 1) {
// Passage du minijeu au thirdGame (slide vers la gauche)
- storage.isMiniGameRunning = 2; // Update storage
isMiniGameRunning = 2;
- thirdGameContainer.y = 0;
+ storage.isMiniGameRunning = 2; // Update storage
thirdGameContainer.x = -2048; // Positionner à droite pour l'animation
+ thirdGameContainer.y = 0;
thirdGameContainer.visible = true;
// Animation du minijeu vers la gauche
tween(miniGameContainer, {
x: 2048
@@ -1489,9 +1490,8 @@
duration: 1000,
easing: tween.easeInOut,
onFinish: function onFinish() {
miniGameContainer.visible = false;
- miniGameContainer.x = 0; // Réinitialiser la position X
}
});
// Animation du thirdGame vers la gauche
tween(thirdGameContainer, {
@@ -1503,20 +1503,19 @@
} else if (isMiniGameRunning === 2) {
// Retour au jeu principal depuis le thirdGame (slide vers le haut)
isMiniGameRunning = 0;
storage.isMiniGameRunning = 0; // Update storage
- mainGameContainer.y = 2732; // Positionner en bas pour l'animation
+ mainGameContainer.x = 0; // Positionner en bas pour l'animation
+ mainGameContainer.y = -2732; // Positionner en bas pour l'animation
mainGameContainer.visible = true;
// Animation du thirdGame vers le haut
tween(thirdGameContainer, {
- y: -2732
+ y: 2732
}, {
duration: 1000,
easing: tween.easeInOut,
onFinish: function onFinish() {
thirdGameContainer.visible = false;
- thirdGameContainer.y = 0; // Réinitialiser la position Y
- thirdGameContainer.x = -2048; // Réinitialiser la position X
}
});
// Animation du jeu principal vers le haut
tween(mainGameContainer, {
@@ -1619,49 +1618,49 @@
switchButton = new SwitchButton();
switchButton.x = 1024;
switchButton.y = 2732 - switchButton.height * 0.5;
foregroundContainer.addChild(switchButton);
- // Ajout du gestionnaire d'événement pour le bouton de changement de jeu
- switchButton.on('down', function (x, y, obj) {
- toggleMiniGame();
- });
// Play bakery music in a loop throughout the game
LK.playMusic('musiqueclicker', {
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;
- }
+ // 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.y = 2732; // Position initiale hors écran
miniGameContainer.x = 0;
+ miniGameContainer.y = 2732; // Position initiale hors écran
game.addChild(miniGameContainer);
miniGameContainer.visible = false;
miniGameBackgroundContainer = new Container();
miniGameContainer.addChild(miniGameBackgroundContainer);
@@ -1677,17 +1676,13 @@
miniGamebackground.y = 2732 / 2;
miniGamebackground.scaleX = 2048 / miniGamebackground.width; // Scale background to fit the game width
miniGamebackground.scaleY = 2732 / miniGamebackground.height; // Scale background to fit the game height
switchButtonMini = new SwitchButton();
- switchButtonMini.x = switchButtonMini.width * 0.5;
+ switchButtonMini.x = switchButtonMini.width * 0.25;
switchButtonMini.y = 1366;
switchButtonMini.rotation = -Math.PI / 2;
switchButtonMini.scale.y = -1;
miniGameForegroundContainer.addChild(switchButtonMini);
- // Ajout du gestionnaire d'événement pour le bouton de changement de jeu
- switchButtonMini.on('down', function (x, y, obj) {
- toggleMiniGame();
- });
// Dwarfs
miniGameDwarfs = []; // Réinitialiser le tableau des nains
for (var i = 0; i < miniGameDwarfCount; i++) {
var dwarf = new Dwarf(i);
@@ -1702,10 +1697,10 @@
cakeRainManager.start();
}
function initializeThirdGameVariables() {
thirdGameContainer = new Container();
+ thirdGameContainer.x = -2048; // Position initiale hors écran (à droite)
thirdGameContainer.y = 0;
- thirdGameContainer.x = 2048; // Position initiale hors écran (à droite)
game.addChild(thirdGameContainer);
thirdGameContainer.visible = false;
thirdGameBackgroundContainer = new Container();
thirdGameContainer.addChild(thirdGameBackgroundContainer);
@@ -1715,9 +1710,10 @@
thirdGameContainer.addChild(thirdGameForegroundContainer);
// Utiliser le même fond que le miniGame pour le moment
thirdGameBackground = thirdGameBackgroundContainer.addChild(LK.getAsset('miniGameBackground', {
anchorX: 0.5,
- anchorY: 0.5
+ anchorY: 0.5,
+ tint: 0xFF0000
}));
thirdGameBackground.x = 2048 / 2;
thirdGameBackground.y = 2732 / 2;
thirdGameBackground.scaleX = 2048 / thirdGameBackground.width; // Scale background to fit the game width
@@ -1727,12 +1723,8 @@
switchButtonThird.x = 1024;
switchButtonThird.y = switchButtonThird.height * 0.5;
switchButtonThird.scale.y = -1;
thirdGameForegroundContainer.addChild(switchButtonThird);
- // Ajout du gestionnaire d'événement pour le bouton de changement de jeu
- switchButtonThird.on('down', function (x, y, obj) {
- toggleMiniGame();
- });
}
// Call the function to initialize game variables
initializeGameVariables();
initializeminiGameVariables();
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