User prompt
Please fix the bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'typeKey')' in or related to this line: 'selectPuppyType(obj.parent.typeKey);' Line Number: 1387
User prompt
Non, laÌ il n'y a que les leÌgendaires ! Chaque type de chiots (fantoÌmes, sireÌnes , vampires, dragons) , doivent aussi avoir leur interface quand le joueur appuie dessus pour en acheter !
User prompt
chaque type de chiots doit avoir sa propre interface pour l'achat! La il y a seulement pour les leÌgendaires ! CorrigeÌ ça âȘđĄ Consider importing and using the following plugins: @upit/storage.v1, @upit/tween.v1
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'typeKey')' in or related to this line: 'selectPuppyType(obj.parent.typeKey);' Line Number: 1387
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'name')' in or related to this line: 'var selectorTitle = new Text2('Combien de chiots ' + type.name + '?', {' Line Number: 1433
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'typeKey')' in or related to this line: 'selectPuppyType(obj.parent.typeKey);' Line Number: 1387
User prompt
CorrigeÌ les probleÌmes
User prompt
Ajoute ces nouveauteÌs a Hot-puppy : en plus, des chiots normaux, Le joueur peut acheter diffeÌrents types suppleÌmentaires de chiots (couÌt en SM) qui ont chacun leurs speÌcialiteÌs, les voici: 1) Chiots fantoÌmes : le joueur peut en acheter 1 a 5 maximum par achat s'il est niveau infeÌrieur a 10, Et de 1 jusqu'aÌ 13 par achat s'il est niveau supeÌrieur a 10, Les chiots fantoÌmes sont simplement des chiots ignoreÌs par Monsieur pervers et Gabriel, Monsieur pervers et Gabriel les ignorent, et ne les attrapent pas, ils ne les voient tout simplement pas, ce qui laisse le temps au joueur de les emmener facilement aÌ la porte de la sortie, et gagner des chiens sauveÌs dans son score,! Le systeÌme des aÌges s'applique aux chiots fantoÌmes, (CouÌte 6 SM par achat) 2) Chiots Dragons : le joueur ne peut pas en acheter avant le niveau 7, le joueur peut en acheter 1 aÌ 6 par achat s'il est de niveau infeÌrieur aÌ 20, et jusqu'aÌ 15 par achat s'il est niveau supeÌrieur a 20! Les chiots dragons, sont visibles et attrapables seulement par Monsieur pervers, et pas par Gabriel, Gabriel les ignores, Mais monsieur pervers peut les attraper de la meÌme façon que les chiots normaux! les chiots dragons comptent triple quand le joueur les sauve! Le systeÌme d'aÌge ne s'applique pas aux chiots dragons (CouÌte 15 SM par achat) 3) Chiots SireÌnes : le joueur peut en acheter seulement s'il est au moins au niveau 10! le joueur peut en acheter seulement de 1 a 7 par achat s'il est niveau infeÌrieur a 30, et jusqu'aÌ 20 par achat s'il est niveau 30 au supeÌrieur! Les chiots sireÌnes ne sont attrapables seulement par Gabriel, Monsieur pervers les ignore totalement, Et les chiots sireÌnes comptent quadruples quand le joueur les sauve! Le systeÌme d'aÌge ne s'applique pas aux chiots sireÌnes (coute 25 SM par achat) 4) Chiots Vampires : le joueur peut en acheter seulement aÌ partir du niveau 15! le joueur peut en acheter de 1 a 9 par achat s'il est niveau infeÌrieur a 40, et jusqu'aÌ 25 s'il est niveau 40 au SupeÌrieur ! les chiots vampires,sont attrapables par Gabriel et Monsieur pervers, mais endorment monsieur pervers pendant 2 minutes quand il attrape un chiot vampire ! les chiots vampires couÌtent Cinquple lors de leur sauvetage ! Le systeÌme des aÌges ne s'applique pas aux chiots vampires (CouÌte 50 SM par achat) 5) Chiots leÌgendaires : disponible seulement pour les joueurs avances aÌ partir du niveau 90! le joueur peut en acheter de 1 aÌ 3 par achat s'il est niveau 90 a 150, Et jusqu'aÌ 7 par achat s'il est niveau supeÌrieur a 150 , jusqu'aÌ la niveau maximal du jeu : le niveau 200! les chiots leÌgendaires, ont tout les pouvoirs, ils sont ignoreÌs par Monsieur pervers et Gabriel, les endorment pendant 10 minutes (que ce soit monsieur pervers ou meÌme Gabriel), deÌs qu'ils rentrent en collision avec , et comptent, comme 20 chiots lors de leur sauvetage ! C'est vraiment les goals des chiots dans le jeu! (CouÌte 1000 SM par achat) Le joueur peut acheter des chiots speÌciaux disponibles pour son niveau, en appuyant sur un bouton rouge a texte noir "boutique", Un menu s'ouvre donc, avec la liste des types de chiots disponibles (avec ceux pas encore disponible pour le niveau du joueur griseÌ, sur lequels le joueur ne peut pas appuyer ni seÌlectionner pour acheter), Le joueur appuie donc sur le type de chiots speÌciaux qu'ils veut acheter, Et le jeu lui demande via un eÌcran qui s'affiche combien il veut en acheter, Il y a donc un keyboard simple bleu avec des touches qui repreÌsentent chaque chiffre, Pour que le joueur entre un chiffre et valide en appuyant sur valider! Les chiots speÌciaux du type acheter ,et le nombre de chiots acheter apparaissent donc dans le jeu jusqu'aÌ leur sauvetage ! âȘđĄ Consider importing and using the following plugins: @upit/storage.v1, @upit/tween.v1
User prompt
Ajoute un systeÌme d'aÌge pour les chiots dans Hot-puppy : Chaque chiot a un aÌge aleÌatoire (entre 1 mois minimum et jusqu'aÌ 20 mois maximum), l'aÌge de chaque chiot est eÌcrit aÌ coÌteÌ de son nom au-dessus de sa teÌte, L'aÌge de chaque chiot ajoute une strateÌgie dans le jeu, sur quels chiots ils faut sauver les premiers, et lesquels faut laisser tomber! : Les chiots de moins de 10 mois, ou de 10 mois maximum (70 % des chiots du jeu), N'ont pas de compeÌtences speÌciales, Ils comptent comme un seul chiot lors de leur sauvetage ou de leur perte Mais les chiots de plus de 10 mois, donc 30 % des chiots, Sont plus preÌcieux, Lors de leur sauvetage ils comptent comme 2 chiots sauveÌs ! âȘđĄ Consider importing and using the following plugins: @upit/storage.v1, @upit/tween.v1
User prompt
Ajoute les assets pour Gabriel, Lucie et Eva !
User prompt
Ajoute ces nouveauteÌs au jeu Hot-puppy : - Eva (9 ans, sĆur de Samantha) : Eva, tout comme Samantha, n'est pas d'accord avec le business horrible de leur peÌre (monsieur pervers), Eva, a le pouvoir d'invoquer Samantha, sans que le joueur est a l'invoquer lui meÌme avec ses SM! Eva ne peut apparaiÌtre dans le jeu, seulement quand le joueur est niveau 5 au supeÌrieur, Eva a 50% de chance d'apparaiÌtre tout les 6 chiots sauveÌ, Mais seulement si Samantha n'est pas deÌjaÌ preÌsente, Eva apparaiÌt aÌ l'eÌcran, puis a une de chance d'invoquer Samantha, qui apparaiÌt et endort monsieur pervers gratuitement sans que le joueur n'est a deÌpense des SMS, Mais Eva n'apparaiÌt pas aÌ chaque fois! Et meÌme quand elle n'apparaiÌt, la deÌcision selon laquelle elle va invoquer Samantha ou non est aleÌatoire ! elle disparaiÌt au bout de 15 secondes si elle n'a pas invoquer Samantha, ou des que Samantha arrive si Eva a invoquer Samantha - Gabriel (12 ans, freÌre de Samantha) : Gabriel, contrairement a Samantha ou Eva, N'est pas un allieÌ du joueur, mais un allieÌ de Monsieur pervers !! Il est d'accord avec le business de son peÌre, Mais c'est seulement car il a peur de Monsieur pervers en vrai, Monsieur pervers tante d'invoquer son fils Gabriel tout les 3 chiots sauveÌ, Mais gabriel ne lui reÌpond pas toujours, La deÌcision selon laquelle Gabriel lui reÌpond ou non, est aleÌatoire, Mais si Monsieur pervers reÌussit a invoquer son fils, il apparaiÌt dans le jeu, et aide son peÌre, Ça signifie, qu'il poursuit lui aussi les chiots pour les attraper, il est encore plus dangereux que son peÌre, car Gabriel peut attraper les chiots avant meÌme que le joueur n'appuie sur eux! La diffeÌrence, est qu'il n'y a pas de game over ou de perte de points si ce n'est que Gabriel qui les a attrapeÌ - Lucie (11 ans, autre sĆur de Samantha) : Lucie est assez neutre par rapport a tout ça, Mais elle deÌteste que sa sĆur Samantha demande beaucoup de SM pour une simple invocation pour des sauvetages normaux , c'est pour cela que Lucie peut diminuer temporairement le prix des SM requis pour invoquer Samantha!, Lucie apparaiÌt dans le jeu toutes les 2 invocations de Samantha, Elle apparaiÌt aÌ l'eÌcran durant 20 secondes, puis baisse le prix des SM requis a l'invocation de samantha de 60% durant 2 minutes ! ApreÌs ce temps, le prix normal de l'invocation est remis ! âȘđĄ Consider importing and using the following plugins: @upit/tween.v1, @upit/storage.v1
User prompt
Attention, Samantha ne touche pas les chiots, elle ne leur veut aucun mal, et monsieur pervers ne peut rien faire aux chiots quand il est endormi
User prompt
Ajoute l'asset requis pour les apparitions de Samantha
User prompt
Ajoute cela au jeu Hot-puppy : Samanta (10 ans, fille de Monsieur pervers) : Samantha est la fille de Monsieur pervers, mais c'est une allieÌe du joueur dans le jeu, elle n'est pas d'accord avec le business tordu de son peÌre, Et essaye d'aider le joueur, Mais attention, elle n'apparaiÌt seulement quand certaines conditions sont remplis : - ajoute une monnaie du jeu : Les SM permettent d'invoquer Samantha, Pour invoquer Samantha , cela couÌte 5 SM la premieÌre fois, Mais plus on l'invoque, plus le prix augmente, A chaque nouvelle invocation, Le prix d'invocation augmente de 30% le joueur gagne des SMS lorsqu'il sauve des chiots (le joueur gagne 3 SM par chiot sauver), Les SM du joueur sont sauvegarder entre les parties ! Le joueur garde ses SM, meÌme apreÌs un game over, le joueur peut voir son nombre de SM posseÌder dans son ui a l'eÌcran dans le jeu, pour invoquer Samantha, Le joueur appuie sur un bouton rose a texte blanc : "Invoque Sam", et Samantha apparaiÌt a l'eÌcran, elle se dirige vers monsieur pervers, quand Samantha est invoquer, monsieur pervers s'endort durant 6 minutes , Laissant le joueur sauver un maximum de chiots durant ce temps laÌ, Puis, durant le temps eÌcouleÌ, Samantha disparaiÌt, et monsieur pervers se reÌveille ! âȘđĄ Consider importing and using the following plugins: @upit/storage.v1, @upit/tween.v1
User prompt
Tout Les messages mesquins doivent avoir un lien avec le fait qu'il est meÌcontent car il voulait tuer les chiots et les servir en hot dog a ses clients
User prompt
Ajoute ça au jeu Hot-puppy : a chaque fois que le joueur sauve un chiot avec succeÌs, Monsieur Pervers n'est pas content et un message aleÌatoire (parmi une base de donneÌes de 75 messages) mesquin s'affiche a l'eÌcran en gras durant et disparaiÌt au bout de 15 secondes âȘđĄ Consider importing and using the following plugins: @upit/tween.v1
User prompt
Fait en sorte que le niveau maximal du jeu soit le niveau 200, et que le joueur recommence au niveau 1 une fois le niveau 200 atteint
User prompt
Ajoute une musique de fond en boucle au jeu
User prompt
De nouveaux chiots doivent eÌtre geÌneÌrer quand il y en a plus dans le jeu a l'eÌcran. et le nombre de chiots a sauveÌ commence par 3 au niveau 1 pour passer au niveau 2, puis double apreÌs a chaque nouveau niveau par rapport au niveau preÌceÌdent
Code edit (1 edits merged)
Please save this source code
User prompt
Hot-puppy
Initial prompt
CreÌer mon jeu "Hot-puppy", Un jeu dans lequel le joueur doit sauver des chiots, d'un fou nommeÌe monsieur Pervers qui veut les tuer pour les cuisiner et les manger! Monsieur pervers veut transformer les chiots en hot dogs et les servir en tant que plat dans son restaurant horrible, Le but du joueur est d'eÌviter cela, et sauver la vie des chiots Plus le joueur sauve de chiots, plus il gagne des points et monte en niveau Voici comment se preÌsente le jeu : Le jeu se deÌroule dans un restaurant (je mettrais un fond personnaliseÌ de restaurant, Merci de me laisser choisir mon assiette personnaliseÌ pour le fond du jeu), le jeu posseÌde 200 niveaux, le jeu se preÌsente ainsi : des chiots apparaissent aleÌatoirement a l'eÌcran (1 seul aÌ la fois si le joueur est de niveau infeÌrieur a 5, entre 2 et 5 en meÌme temps si le joueur est de niveau 5 a 10, et entre 5 et 10 a la fois si le joueur est de niveau supeÌrieur aÌ 10), De nouveaux chiots sont geÌneÌrer en jeu dans le restaurant, quand il y en a plus a l'eÌcran. une porte de sortie se situe en bas du jeu, Le joueur doit deÌplaceÌ chaque chiot un par un, vers la porte de sortie, quand le chiot entre en collision avec la porte de sortie, il disparaiÌt, et il est sauveÌ, Le joueur gagne 1 chiot sauveÌ dans son score de chiots sauveÌ du jeu, le joueur deÌplace chaque chiot en appuyant sur le chiot, et en utilisant des bouttons directionnels pour le deÌplacer, Le fou monsieur pervers est aussi preÌsent dans ce restaurant, il avance lentement, mais il est surtout occupeÌ aÌ faire cuire de la viande par-dessus une marmite (repreÌsente ça dans le jeu), il ne s'inteÌressera a un chiot, seulement aÌ partir du moment ouÌ le joueur a appuyeÌ dessus pour le deÌplacer, Il se dirigera alors doucement vers le chiot, Et il faudra que le joueur le fasse atteindre la porte de sortie avant que Monsieur pervers entre en collision avec le chiot, Sinon, le chiot disparaiÌt, et le fou la eut! Le joueur perd 1 chiot sauveÌ dans son score de chiots sauveÌ Le joueur doit avoir sauveÌ 3 chiots pour passer du niveau 1 au niveau 2, 6 chiots pour passer du niveau 2 au niveau 3, Et aÌ chaque nouveau niveau, le nombre de chiots a sauveÌ double par rapport au niveau preÌceÌdent pour monter au niveau supeÌrieur ! Le nom du fou est eÌcrit au-dessus de lui dans le jeu, et chaque chiot a un nom geÌneÌreÌ aleÌatoirement par le jeu parmi une base de donneÌes de 50 noms de chiots diffeÌrents, le nom de chaque chiot est eÌcrit en dessous de lui VoilaÌ!
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); var storage = LK.import("@upit/storage.v1"); /**** * Classes ****/ var DirectionalButton = Container.expand(function (direction) { var self = Container.call(this); var buttonGraphics = self.attachAsset(direction + 'button', { anchorX: 0.5, anchorY: 0.5 }); var buttonText = new Text2(direction.toUpperCase(), { size: 30, fill: 0x000000 }); buttonText.anchor.set(0.5, 0.5); self.addChild(buttonText); self.direction = direction; self.down = function (x, y, obj) { if (selectedPuppy && selectedPuppy.isSelected) { var moveDistance = 60; switch (self.direction) { case 'up': selectedPuppy.y -= moveDistance; break; case 'down': selectedPuppy.y += moveDistance; break; case 'left': selectedPuppy.x -= moveDistance; break; case 'right': selectedPuppy.x += moveDistance; break; } // Keep puppy within bounds selectedPuppy.x = Math.max(60, Math.min(1988, selectedPuppy.x)); selectedPuppy.y = Math.max(60, Math.min(2400, selectedPuppy.y)); } }; return self; }); var DragonPuppy = Container.expand(function () { var self = Container.call(this); var puppyGraphics = self.attachAsset('dragonpuppy', { anchorX: 0.5, anchorY: 0.5 }); puppyGraphics.tint = 0xff4444; // Red tint for dragon var puppyNames = ['Buddy', 'Max', 'Bella', 'Charlie', 'Lucy', 'Cooper', 'Luna', 'Bailey', 'Daisy', 'Rocky', 'Molly', 'Jack', 'Lola', 'Duke', 'Sadie', 'Tucker', 'Chloe', 'Bear', 'Sophie', 'Teddy', 'Roxy', 'Buster', 'Coco', 'Gus', 'Penny', 'Oscar', 'Nala', 'Milo', 'Rosie', 'Leo', 'Zoey', 'Zeus', 'Lily', 'Finn', 'Ruby', 'Ollie', 'Stella', 'Jasper', 'Ellie', 'Murphy', 'Maggie', 'Toby', 'Gracie', 'Oliver', 'Abby', 'Winston', 'Zoe', 'Bentley', 'Mia', 'Harley']; self.name = puppyNames[Math.floor(Math.random() * puppyNames.length)]; self.isSelected = false; self.moveSpeed = 8; self.lastX = 0; self.lastY = 0; self.type = 'dragon'; var nameText = new Text2(self.name + ' [Dragon]', { size: 35, fill: 0xff4444 }); nameText.anchor.set(0.5, 0.5); nameText.y = -80; self.addChild(nameText); self.down = function (x, y, obj) { selectedPuppy = self; // Clear all selections for (var i = 0; i < puppies.length; i++) { puppies[i].isSelected = false; puppies[i].tint = 0xFFFFFF; } for (var i = 0; i < ghostPuppies.length; i++) { ghostPuppies[i].isSelected = false; ghostPuppies[i].tint = 0xFFFFFF; } for (var i = 0; i < dragonPuppies.length; i++) { dragonPuppies[i].isSelected = false; dragonPuppies[i].tint = 0xFFFFFF; } for (var i = 0; i < sirenPuppies.length; i++) { sirenPuppies[i].isSelected = false; sirenPuppies[i].tint = 0xFFFFFF; } for (var i = 0; i < vampirePuppies.length; i++) { vampirePuppies[i].isSelected = false; vampirePuppies[i].tint = 0xFFFFFF; } for (var i = 0; i < legendaryPuppies.length; i++) { legendaryPuppies[i].isSelected = false; legendaryPuppies[i].tint = 0xFFFFFF; } self.isSelected = true; self.tint = 0xFFFF00; }; self.moveTowards = function (targetX, targetY) { var dx = targetX - self.x; var dy = targetY - self.y; var distance = Math.sqrt(dx * dx + dy * dy); if (distance > self.moveSpeed) { self.x += dx / distance * self.moveSpeed; self.y += dy / distance * self.moveSpeed; } else { self.x = targetX; self.y = targetY; } }; return self; }); var Eva = Container.expand(function () { var self = Container.call(this); var evaGraphics = self.attachAsset('eva', { anchorX: 0.5, anchorY: 0.5 }); var nameText = new Text2('Eva', { size: 40, fill: 0x9932CC }); nameText.anchor.set(0.5, 0.5); nameText.y = -100; self.addChild(nameText); return self; }); var Gabriel = Container.expand(function () { var self = Container.call(this); var gabrielGraphics = self.attachAsset('gabriel', { anchorX: 0.5, anchorY: 0.5 }); var nameText = new Text2('Gabriel', { size: 40, fill: 0x8B0000 }); nameText.anchor.set(0.5, 0.5); nameText.y = -100; self.addChild(nameText); self.moveSpeed = 4; self.targetPuppy = null; self.update = function () { if (selectedPuppy && selectedPuppy.isSelected) { self.targetPuppy = selectedPuppy; } if (self.targetPuppy) { var dx = self.targetPuppy.x - self.x; var dy = self.targetPuppy.y - self.y; var distance = Math.sqrt(dx * dx + dy * dy); if (distance > self.moveSpeed) { self.x += dx / distance * self.moveSpeed; self.y += dy / distance * self.moveSpeed; } } }; return self; }); var GhostPuppy = Container.expand(function () { var self = Container.call(this); var puppyGraphics = self.attachAsset('ghostpuppy', { anchorX: 0.5, anchorY: 0.5 }); puppyGraphics.alpha = 0.7; // Semi-transparent for ghost effect var puppyNames = ['Buddy', 'Max', 'Bella', 'Charlie', 'Lucy', 'Cooper', 'Luna', 'Bailey', 'Daisy', 'Rocky', 'Molly', 'Jack', 'Lola', 'Duke', 'Sadie', 'Tucker', 'Chloe', 'Bear', 'Sophie', 'Teddy', 'Roxy', 'Buster', 'Coco', 'Gus', 'Penny', 'Oscar', 'Nala', 'Milo', 'Rosie', 'Leo', 'Zoey', 'Zeus', 'Lily', 'Finn', 'Ruby', 'Ollie', 'Stella', 'Jasper', 'Ellie', 'Murphy', 'Maggie', 'Toby', 'Gracie', 'Oliver', 'Abby', 'Winston', 'Zoe', 'Bentley', 'Mia', 'Harley']; self.name = puppyNames[Math.floor(Math.random() * puppyNames.length)]; self.age = Math.floor(Math.random() * 20) + 1; // Random age between 1-20 months self.isSelected = false; self.moveSpeed = 8; self.lastX = 0; self.lastY = 0; self.type = 'ghost'; var nameText = new Text2(self.name + ' (' + self.age + ' mois) [FantĂŽme]', { size: 35, fill: 0x9999ff }); nameText.anchor.set(0.5, 0.5); nameText.y = -80; self.addChild(nameText); self.down = function (x, y, obj) { selectedPuppy = self; // Clear all selections for (var i = 0; i < puppies.length; i++) { puppies[i].isSelected = false; puppies[i].tint = 0xFFFFFF; } for (var i = 0; i < ghostPuppies.length; i++) { ghostPuppies[i].isSelected = false; ghostPuppies[i].tint = 0xFFFFFF; } for (var i = 0; i < dragonPuppies.length; i++) { dragonPuppies[i].isSelected = false; dragonPuppies[i].tint = 0xFFFFFF; } for (var i = 0; i < sirenPuppies.length; i++) { sirenPuppies[i].isSelected = false; sirenPuppies[i].tint = 0xFFFFFF; } for (var i = 0; i < vampirePuppies.length; i++) { vampirePuppies[i].isSelected = false; vampirePuppies[i].tint = 0xFFFFFF; } for (var i = 0; i < legendaryPuppies.length; i++) { legendaryPuppies[i].isSelected = false; legendaryPuppies[i].tint = 0xFFFFFF; } self.isSelected = true; self.tint = 0xFFFF00; }; self.moveTowards = function (targetX, targetY) { var dx = targetX - self.x; var dy = targetY - self.y; var distance = Math.sqrt(dx * dx + dy * dy); if (distance > self.moveSpeed) { self.x += dx / distance * self.moveSpeed; self.y += dy / distance * self.moveSpeed; } else { self.x = targetX; self.y = targetY; } }; return self; }); var LegendaryPuppy = Container.expand(function () { var self = Container.call(this); var puppyGraphics = self.attachAsset('legendarypuppy', { anchorX: 0.5, anchorY: 0.5 }); puppyGraphics.tint = 0xFFD700; // Gold tint for legendary var puppyNames = ['Buddy', 'Max', 'Bella', 'Charlie', 'Lucy', 'Cooper', 'Luna', 'Bailey', 'Daisy', 'Rocky', 'Molly', 'Jack', 'Lola', 'Duke', 'Sadie', 'Tucker', 'Chloe', 'Bear', 'Sophie', 'Teddy', 'Roxy', 'Buster', 'Coco', 'Gus', 'Penny', 'Oscar', 'Nala', 'Milo', 'Rosie', 'Leo', 'Zoey', 'Zeus', 'Lily', 'Finn', 'Ruby', 'Ollie', 'Stella', 'Jasper', 'Ellie', 'Murphy', 'Maggie', 'Toby', 'Gracie', 'Oliver', 'Abby', 'Winston', 'Zoe', 'Bentley', 'Mia', 'Harley']; self.name = puppyNames[Math.floor(Math.random() * puppyNames.length)]; self.isSelected = false; self.moveSpeed = 8; self.lastX = 0; self.lastY = 0; self.type = 'legendary'; var nameText = new Text2(self.name + ' [LĂGENDAIRE]', { size: 35, fill: 0xFFD700 }); nameText.anchor.set(0.5, 0.5); nameText.y = -80; self.addChild(nameText); self.down = function (x, y, obj) { selectedPuppy = self; // Clear all selections for (var i = 0; i < puppies.length; i++) { puppies[i].isSelected = false; puppies[i].tint = 0xFFFFFF; } for (var i = 0; i < ghostPuppies.length; i++) { ghostPuppies[i].isSelected = false; ghostPuppies[i].tint = 0xFFFFFF; } for (var i = 0; i < dragonPuppies.length; i++) { dragonPuppies[i].isSelected = false; dragonPuppies[i].tint = 0xFFFFFF; } for (var i = 0; i < sirenPuppies.length; i++) { sirenPuppies[i].isSelected = false; sirenPuppies[i].tint = 0xFFFFFF; } for (var i = 0; i < vampirePuppies.length; i++) { vampirePuppies[i].isSelected = false; vampirePuppies[i].tint = 0xFFFFFF; } for (var i = 0; i < legendaryPuppies.length; i++) { legendaryPuppies[i].isSelected = false; legendaryPuppies[i].tint = 0xFFFFFF; } self.isSelected = true; self.tint = 0xFFFF00; }; self.moveTowards = function (targetX, targetY) { var dx = targetX - self.x; var dy = targetY - self.y; var distance = Math.sqrt(dx * dx + dy * dy); if (distance > self.moveSpeed) { self.x += dx / distance * self.moveSpeed; self.y += dy / distance * self.moveSpeed; } else { self.x = targetX; self.y = targetY; } }; return self; }); var Lucie = Container.expand(function () { var self = Container.call(this); var lucieGraphics = self.attachAsset('lucie', { anchorX: 0.5, anchorY: 0.5 }); var nameText = new Text2('Lucie', { size: 40, fill: 0x00CED1 }); nameText.anchor.set(0.5, 0.5); nameText.y = -100; self.addChild(nameText); return self; }); var MrPervers = Container.expand(function () { var self = Container.call(this); var chefGraphics = self.attachAsset('mrpervers', { anchorX: 0.5, anchorY: 0.5 }); var nameText = new Text2('Mr. Pervers', { size: 50, fill: 0xFF0000 }); nameText.anchor.set(0.5, 0.5); nameText.y = -100; self.addChild(nameText); self.moveSpeed = 3; self.targetPuppy = null; self.lastTargetX = 0; self.lastTargetY = 0; self.update = function () { // Don't move if Samantha made Mr. Pervers sleep if (samanthaActive) { return; } if (selectedPuppy && selectedPuppy.isSelected) { self.targetPuppy = selectedPuppy; } if (self.targetPuppy) { var dx = self.targetPuppy.x - self.x; var dy = self.targetPuppy.y - self.y; var distance = Math.sqrt(dx * dx + dy * dy); if (distance > self.moveSpeed) { self.x += dx / distance * self.moveSpeed; self.y += dy / distance * self.moveSpeed; } } }; return self; }); var Puppy = Container.expand(function () { var self = Container.call(this); var puppyGraphics = self.attachAsset('puppy', { anchorX: 0.5, anchorY: 0.5 }); var puppyNames = ['Buddy', 'Max', 'Bella', 'Charlie', 'Lucy', 'Cooper', 'Luna', 'Bailey', 'Daisy', 'Rocky', 'Molly', 'Jack', 'Lola', 'Duke', 'Sadie', 'Tucker', 'Chloe', 'Bear', 'Sophie', 'Teddy', 'Roxy', 'Buster', 'Coco', 'Gus', 'Penny', 'Oscar', 'Nala', 'Milo', 'Rosie', 'Leo', 'Zoey', 'Zeus', 'Lily', 'Finn', 'Ruby', 'Ollie', 'Stella', 'Jasper', 'Ellie', 'Murphy', 'Maggie', 'Toby', 'Gracie', 'Oliver', 'Abby', 'Winston', 'Zoe', 'Bentley', 'Mia', 'Harley']; self.name = puppyNames[Math.floor(Math.random() * puppyNames.length)]; self.age = Math.floor(Math.random() * 20) + 1; // Random age between 1-20 months self.isSelected = false; self.moveSpeed = 8; self.lastX = 0; self.lastY = 0; var nameText = new Text2(self.name + ' (' + self.age + ' mois)', { size: 40, fill: 0x000000 }); nameText.anchor.set(0.5, 0.5); nameText.y = -80; self.addChild(nameText); self.down = function (x, y, obj) { selectedPuppy = self; for (var i = 0; i < puppies.length; i++) { puppies[i].isSelected = false; puppies[i].tint = 0xFFFFFF; } self.isSelected = true; self.tint = 0xFFFF00; }; self.moveTowards = function (targetX, targetY) { var dx = targetX - self.x; var dy = targetY - self.y; var distance = Math.sqrt(dx * dx + dy * dy); if (distance > self.moveSpeed) { self.x += dx / distance * self.moveSpeed; self.y += dy / distance * self.moveSpeed; } else { self.x = targetX; self.y = targetY; } }; return self; }); var Samantha = Container.expand(function () { var self = Container.call(this); // Use dedicated Samantha asset var samanthaGraphics = self.attachAsset('samantha', { anchorX: 0.5, anchorY: 0.5 }); var nameText = new Text2('Samantha', { size: 40, fill: 0xFF1493 }); nameText.anchor.set(0.5, 0.5); nameText.y = -100; self.addChild(nameText); self.moveSpeed = 5; self.moveTowards = function (targetX, targetY) { var dx = targetX - self.x; var dy = targetY - self.y; var distance = Math.sqrt(dx * dx + dy * dy); if (distance > self.moveSpeed) { self.x += dx / distance * self.moveSpeed; self.y += dy / distance * self.moveSpeed; } else { self.x = targetX; self.y = targetY; } }; return self; }); var SirenPuppy = Container.expand(function () { var self = Container.call(this); var puppyGraphics = self.attachAsset('sirenpuppy', { anchorX: 0.5, anchorY: 0.5 }); puppyGraphics.tint = 0x44ffff; // Cyan tint for siren var puppyNames = ['Buddy', 'Max', 'Bella', 'Charlie', 'Lucy', 'Cooper', 'Luna', 'Bailey', 'Daisy', 'Rocky', 'Molly', 'Jack', 'Lola', 'Duke', 'Sadie', 'Tucker', 'Chloe', 'Bear', 'Sophie', 'Teddy', 'Roxy', 'Buster', 'Coco', 'Gus', 'Penny', 'Oscar', 'Nala', 'Milo', 'Rosie', 'Leo', 'Zoey', 'Zeus', 'Lily', 'Finn', 'Ruby', 'Ollie', 'Stella', 'Jasper', 'Ellie', 'Murphy', 'Maggie', 'Toby', 'Gracie', 'Oliver', 'Abby', 'Winston', 'Zoe', 'Bentley', 'Mia', 'Harley']; self.name = puppyNames[Math.floor(Math.random() * puppyNames.length)]; self.isSelected = false; self.moveSpeed = 8; self.lastX = 0; self.lastY = 0; self.type = 'siren'; var nameText = new Text2(self.name + ' [SirĂšne]', { size: 35, fill: 0x44ffff }); nameText.anchor.set(0.5, 0.5); nameText.y = -80; self.addChild(nameText); self.down = function (x, y, obj) { selectedPuppy = self; // Clear all selections for (var i = 0; i < puppies.length; i++) { puppies[i].isSelected = false; puppies[i].tint = 0xFFFFFF; } for (var i = 0; i < ghostPuppies.length; i++) { ghostPuppies[i].isSelected = false; ghostPuppies[i].tint = 0xFFFFFF; } for (var i = 0; i < dragonPuppies.length; i++) { dragonPuppies[i].isSelected = false; dragonPuppies[i].tint = 0xFFFFFF; } for (var i = 0; i < sirenPuppies.length; i++) { sirenPuppies[i].isSelected = false; sirenPuppies[i].tint = 0xFFFFFF; } for (var i = 0; i < vampirePuppies.length; i++) { vampirePuppies[i].isSelected = false; vampirePuppies[i].tint = 0xFFFFFF; } for (var i = 0; i < legendaryPuppies.length; i++) { legendaryPuppies[i].isSelected = false; legendaryPuppies[i].tint = 0xFFFFFF; } self.isSelected = true; self.tint = 0xFFFF00; }; self.moveTowards = function (targetX, targetY) { var dx = targetX - self.x; var dy = targetY - self.y; var distance = Math.sqrt(dx * dx + dy * dy); if (distance > self.moveSpeed) { self.x += dx / distance * self.moveSpeed; self.y += dy / distance * self.moveSpeed; } else { self.x = targetX; self.y = targetY; } }; return self; }); var VampirePuppy = Container.expand(function () { var self = Container.call(this); var puppyGraphics = self.attachAsset('vampirepuppy', { anchorX: 0.5, anchorY: 0.5 }); puppyGraphics.tint = 0x800080; // Purple tint for vampire var puppyNames = ['Buddy', 'Max', 'Bella', 'Charlie', 'Lucy', 'Cooper', 'Luna', 'Bailey', 'Daisy', 'Rocky', 'Molly', 'Jack', 'Lola', 'Duke', 'Sadie', 'Tucker', 'Chloe', 'Bear', 'Sophie', 'Teddy', 'Roxy', 'Buster', 'Coco', 'Gus', 'Penny', 'Oscar', 'Nala', 'Milo', 'Rosie', 'Leo', 'Zoey', 'Zeus', 'Lily', 'Finn', 'Ruby', 'Ollie', 'Stella', 'Jasper', 'Ellie', 'Murphy', 'Maggie', 'Toby', 'Gracie', 'Oliver', 'Abby', 'Winston', 'Zoe', 'Bentley', 'Mia', 'Harley']; self.name = puppyNames[Math.floor(Math.random() * puppyNames.length)]; self.isSelected = false; self.moveSpeed = 8; self.lastX = 0; self.lastY = 0; self.type = 'vampire'; var nameText = new Text2(self.name + ' [Vampire]', { size: 35, fill: 0x800080 }); nameText.anchor.set(0.5, 0.5); nameText.y = -80; self.addChild(nameText); self.down = function (x, y, obj) { selectedPuppy = self; // Clear all selections for (var i = 0; i < puppies.length; i++) { puppies[i].isSelected = false; puppies[i].tint = 0xFFFFFF; } for (var i = 0; i < ghostPuppies.length; i++) { ghostPuppies[i].isSelected = false; ghostPuppies[i].tint = 0xFFFFFF; } for (var i = 0; i < dragonPuppies.length; i++) { dragonPuppies[i].isSelected = false; dragonPuppies[i].tint = 0xFFFFFF; } for (var i = 0; i < sirenPuppies.length; i++) { sirenPuppies[i].isSelected = false; sirenPuppies[i].tint = 0xFFFFFF; } for (var i = 0; i < vampirePuppies.length; i++) { vampirePuppies[i].isSelected = false; vampirePuppies[i].tint = 0xFFFFFF; } for (var i = 0; i < legendaryPuppies.length; i++) { legendaryPuppies[i].isSelected = false; legendaryPuppies[i].tint = 0xFFFFFF; } self.isSelected = true; self.tint = 0xFFFF00; }; self.moveTowards = function (targetX, targetY) { var dx = targetX - self.x; var dy = targetY - self.y; var distance = Math.sqrt(dx * dx + dy * dy); if (distance > self.moveSpeed) { self.x += dx / distance * self.moveSpeed; self.y += dy / distance * self.moveSpeed; } else { self.x = targetX; self.y = targetY; } }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0xF5DEB3 }); /**** * Game Code ****/ // Game variables var currentLevel = storage.currentLevel || 1; var puppiesSaved = 0; var puppiesRequired = currentLevel === 1 ? 3 : Math.pow(2, currentLevel - 1) * 3; var puppies = []; var selectedPuppy = null; var mrPervers = null; var exitDoor = null; var pot = null; var upButton = null; var downButton = null; var leftButton = null; var rightButton = null; // SM currency system var playerSM = storage.playerSM || 0; var samanthaCost = storage.samanthaCost || 5; var originalSamanthaCost = samanthaCost; var samanthaActive = false; var samanthaEndTime = 0; var samanthaCharacter = null; // Eva tracking var puppiesSavedForEva = 0; var evaCharacter = null; var evaEndTime = 0; // Gabriel tracking var puppiesSavedForGabriel = 0; var gabrielCharacter = null; // Lucie tracking var samanthaInvocations = 0; var lucieCharacter = null; var lucieActive = false; var lucieEndTime = 0; var lucieDiscountActive = false; var lucieDiscountEndTime = 0; // Special puppy shop system var specialPuppyShop = { isOpen: false, selectedType: null }; // Special puppy types and costs var PUPPY_TYPES = { GHOST: { name: 'FantĂŽmes', cost: 6, multiplier: 1, hasAge: true }, DRAGON: { name: 'Dragons', cost: 15, multiplier: 3, hasAge: false }, SIREN: { name: 'SirĂšnes', cost: 25, multiplier: 4, hasAge: false }, VAMPIRE: { name: 'Vampires', cost: 50, multiplier: 5, hasAge: false }, LEGENDARY: { name: 'LĂ©gendaires', cost: 1000, multiplier: 20, hasAge: false } }; // Special puppies arrays var ghostPuppies = []; var dragonPuppies = []; var sirenPuppies = []; var vampirePuppies = []; var legendaryPuppies = []; // Mr. Pervers mean messages var perversMessages = ["NON! Mes hot dogs de chiot!", "Ce chiot Ă©tait parfait pour ma saucisse!", "Tu ruines mon menu hot dog!", "J'avais prĂ©vu de le servir grillĂ©!", "Mes clients voulaient ce hot dog!", "Cette viande de chiot Ă©tait premium!", "Tu gĂąches ma spĂ©cialitĂ© hot dog!", "Ce chiot aurait fait un dĂ©licieux hot dog!", "Mes hot dogs de chiot sont cĂ©lĂšbres!", "Tu m'empĂȘches de cuisiner mes hot dogs!", "Ce chiot Ă©tait destinĂ© Ă ma marmite!", "Mes hot dogs seront moins savoureux!", "Tu voles mes ingrĂ©dients Ă hot dog!", "Ce chiot Ă©tait ma recette secrĂšte!", "Mes clients adorent mes hot dogs de chiot!", "Tu sabotes ma production de hot dogs!", "Cette viande Ă©tait parfaite pour griller!", "Mes hot dogs de chiot sont uniques!", "Tu dĂ©truis mon business de hot dogs!", "Ce chiot aurait nourri mes clients!", "Ma spĂ©cialitĂ© hot dog est ruinĂ©e!", "Tu m'empĂȘches de servir mes hot dogs!", "Cette viande de chiot Ă©tait fraĂźche!", "Mes hot dogs perdent leur goĂ»t!", "Tu voles ma matiĂšre premiĂšre!", "Ce chiot Ă©tait mon meilleur ingrĂ©dient!", "Mes hot dogs de chiot sont ma fiertĂ©!", "Tu ruines ma rĂ©putation de hot dogs!", "Cette viande Ă©tait prĂȘte Ă cuire!", "Mes clients vont ĂȘtre déçus!", "Tu gĂąches ma recette de hot dog!", "Ce chiot Ă©tait parfait pour les saucisses!", "Mes hot dogs de chiot sont artistiques!", "Tu m'empĂȘches de nourrir mes clients!", "Cette viande aurait Ă©tĂ© dĂ©licieuse!", "Mes hot dogs perdent leur originalitĂ©!", "Tu sabotes ma cuisine de hot dogs!", "Ce chiot Ă©tait ma fortune culinaire!", "Mes hot dogs de chiot sont lĂ©gendaires!", "Tu dĂ©truis mon art du hot dog!", "Cette viande Ă©tait mon inspiration!", "Mes hot dogs ne seront plus pareils!", "Tu voles mes profits de hot dogs!", "Ce chiot Ă©tait destinĂ© au grill!", "Mes hot dogs de chiot sont ma passion!", "Tu ruines mes ventes de hot dogs!", "Cette viande Ă©tait exceptionnelle!", "Mes hot dogs perdent leur magie!", "Tu gĂąches ma tradition culinaire!", "Ce chiot Ă©tait mon chef-d'Ćuvre!", "Mes hot dogs de chiot sont irremplaçables!", "Tu m'empĂȘches de rĂ©galer mes clients!", "Cette viande Ă©tait ma signature!", "Mes hot dogs perdent leur authenticitĂ©!", "Tu sabotes mon empire hot dog!", "Ce chiot Ă©tait mon trĂ©sor culinaire!", "Mes hot dogs de chiot sont mon hĂ©ritage!", "Tu dĂ©truis ma chaĂźne de restaurants!", "Cette viande Ă©tait ma spĂ©cialitĂ©!", "Mes hot dogs ne seront plus uniques!", "Tu voles mon succĂšs culinaire!", "Ce chiot Ă©tait parfait pour mes saucisses!", "Mes hot dogs de chiot sont ma vie!", "Tu ruines mes rĂȘves de restaurateur!", "Cette viande Ă©tait mon avenir!", "Mes hot dogs perdent leur saveur!", "Tu gĂąches ma rĂ©putation mondiale!", "Ce chiot Ă©tait destinĂ© Ă mes clients!", "Mes hot dogs de chiot sont mon gĂ©nie!", "Tu m'empĂȘches de devenir riche!", "Cette viande Ă©tait ma rĂ©volution!", "Mes hot dogs ne seront plus parfaits!", "Tu sabotes mon innovation culinaire!", "Ce chiot Ă©tait mon diamant brut!", "Mes hot dogs de chiot sont mon destin!", "Tu dĂ©truis mon rĂȘve amĂ©ricain!"]; var messageText = null; // UI elements var levelText = new Text2('Level: ' + currentLevel, { size: 60, fill: 0x000000 }); levelText.anchor.set(0, 0); levelText.x = 120; levelText.y = 50; LK.gui.topLeft.addChild(levelText); var savedText = new Text2('Saved: 0/' + puppiesRequired, { size: 60, fill: 0x000000 }); savedText.anchor.set(0.5, 0); savedText.x = 0; savedText.y = 50; LK.gui.top.addChild(savedText); var scoreText = new Text2('Score: ' + LK.getScore(), { size: 60, fill: 0x000000 }); scoreText.anchor.set(1, 0); scoreText.x = 0; scoreText.y = 50; LK.gui.topRight.addChild(scoreText); var smText = new Text2('SM: ' + playerSM, { size: 50, fill: 0x000000 }); smText.anchor.set(1, 0); smText.x = 0; smText.y = 120; LK.gui.topRight.addChild(smText); // Background var background = game.addChild(LK.getAsset('background', { anchorX: 0, anchorY: 0, x: 0, y: 0 })); // Exit door exitDoor = game.addChild(LK.getAsset('exitdoor', { anchorX: 0.5, anchorY: 1, x: 1024, y: 2700 })); var exitText = new Text2('EXIT', { size: 40, fill: 0xFFFFFF }); exitText.anchor.set(0.5, 0.5); exitText.y = -150; exitDoor.addChild(exitText); // Cooking pot pot = game.addChild(LK.getAsset('pot', { anchorX: 0.5, anchorY: 0.5, x: 1024, y: 400 })); // Mr. Pervers mrPervers = game.addChild(new MrPervers()); mrPervers.x = 1024; mrPervers.y = 500; // Directional buttons upButton = game.addChild(new DirectionalButton('up')); upButton.x = 1700; upButton.y = 2200; downButton = game.addChild(new DirectionalButton('down')); downButton.x = 1700; downButton.y = 2400; leftButton = game.addChild(new DirectionalButton('left')); leftButton.x = 1600; leftButton.y = 2300; rightButton = game.addChild(new DirectionalButton('right')); rightButton.x = 1800; rightButton.y = 2300; // Invoke Samantha button var invokeSamButton = new Container(); var invokeSamGraphics = invokeSamButton.attachAsset('downbutton', { anchorX: 0.5, anchorY: 0.5, scaleX: 2, scaleY: 1.5 }); invokeSamGraphics.tint = 0xFF69B4; // Pink color var invokeSamText = new Text2('Invoque Sam\n(' + samanthaCost + ' SM)', { size: 30, fill: 0xFFFFFF }); invokeSamText.anchor.set(0.5, 0.5); invokeSamButton.addChild(invokeSamText); invokeSamButton.x = 300; invokeSamButton.y = 2300; invokeSamButton.down = function (x, y, obj) { var currentCost = lucieDiscountActive ? Math.ceil(samanthaCost * 0.4) : samanthaCost; if (playerSM >= currentCost && !samanthaActive) { invokeSamantha(); } }; game.addChild(invokeSamButton); // Shop button var shopButton = new Container(); var shopGraphics = shopButton.attachAsset('shopButton', { anchorX: 0.5, anchorY: 0.5 }); var shopText = new Text2('Boutique', { size: 30, fill: 0x000000 }); shopText.anchor.set(0.5, 0.5); shopButton.addChild(shopText); shopButton.x = 500; shopButton.y = 2300; shopButton.down = function (x, y, obj) { if (!specialPuppyShop.isOpen) { openShop(); } }; game.addChild(shopButton); // Functions function spawnPuppies() { var numPuppies = 1; if (currentLevel >= 11) { numPuppies = Math.floor(Math.random() * 6) + 5; // 5-10 puppies } else if (currentLevel >= 5) { numPuppies = Math.floor(Math.random() * 4) + 2; // 2-5 puppies } for (var i = 0; i < numPuppies; i++) { var puppy = new Puppy(); puppy.x = Math.random() * 1500 + 300; puppy.y = Math.random() * 1000 + 800; puppy.lastX = puppy.x; puppy.lastY = puppy.y; puppies.push(puppy); game.addChild(puppy); } } function checkCollisions() { // Check normal puppies for (var i = puppies.length - 1; i >= 0; i--) { var puppy = puppies[i]; // Check if puppy reached exit if (puppy.intersects(exitDoor)) { // Puppies over 10 months count as 2 saved puppies var puppyValue = puppy.age > 10 ? 2 : 1; puppiesSaved += puppyValue; puppiesSavedForEva += puppyValue; puppiesSavedForGabriel += puppyValue; LK.setScore(LK.getScore() + puppyValue); // Give SM reward playerSM += 3; storage.playerSM = playerSM; LK.getSound('puppysaved').play(); // Show Mr. Pervers angry message (only if Mr. Pervers is awake) if (!samanthaActive) { showPerversMessage(); } // Check Eva appearance (level 5+, every 6 puppies saved, 50% chance) if (currentLevel >= 5 && puppiesSavedForEva >= 6 && !samanthaActive && !evaCharacter) { puppiesSavedForEva = 0; if (Math.random() < 0.5) { spawnEva(); } } // Check Gabriel appearance (every 3 puppies saved, random chance) if (puppiesSavedForGabriel >= 3 && !gabrielCharacter) { puppiesSavedForGabriel = 0; if (Math.random() < 0.5) { spawnGabriel(); } } puppy.destroy(); puppies.splice(i, 1); if (selectedPuppy === puppy) { selectedPuppy = null; } updateUI(); if (puppiesSaved >= puppiesRequired) { nextLevel(); } continue; } // Check if puppy caught by Mr. Pervers (only if Mr. Pervers is not sleeping) if (puppy.intersects(mrPervers) && !samanthaActive && LK.ticks >= vampireSleepEndTime) { LK.setScore(LK.getScore() - 1); LK.getSound('puppycaught').play(); puppy.destroy(); puppies.splice(i, 1); if (selectedPuppy === puppy) { selectedPuppy = null; } updateUI(); if (puppies.length === 0 && puppiesSaved < puppiesRequired) { LK.showGameOver(); } } // Check if puppy caught by Gabriel (no game over, just remove puppy) if (gabrielCharacter && puppy.intersects(gabrielCharacter)) { puppy.destroy(); puppies.splice(i, 1); if (selectedPuppy === puppy) { selectedPuppy = null; } continue; } } // Check ghost puppies (ignored by Mr. Pervers and Gabriel) for (var i = ghostPuppies.length - 1; i >= 0; i--) { var puppy = ghostPuppies[i]; if (puppy.intersects(exitDoor)) { var puppyValue = puppy.age > 10 ? 2 : 1; puppiesSaved += puppyValue; puppiesSavedForEva += puppyValue; puppiesSavedForGabriel += puppyValue; LK.setScore(LK.getScore() + puppyValue); playerSM += 3; storage.playerSM = playerSM; LK.getSound('puppysaved').play(); if (!samanthaActive) { showPerversMessage(); } // Check Eva and Gabriel appearances if (currentLevel >= 5 && puppiesSavedForEva >= 6 && !samanthaActive && !evaCharacter) { puppiesSavedForEva = 0; if (Math.random() < 0.5) { spawnEva(); } } if (puppiesSavedForGabriel >= 3 && !gabrielCharacter) { puppiesSavedForGabriel = 0; if (Math.random() < 0.5) { spawnGabriel(); } } puppy.destroy(); ghostPuppies.splice(i, 1); if (selectedPuppy === puppy) { selectedPuppy = null; } updateUI(); if (puppiesSaved >= puppiesRequired) { nextLevel(); } } } // Check dragon puppies (only catchable by Mr. Pervers, ignored by Gabriel) for (var i = dragonPuppies.length - 1; i >= 0; i--) { var puppy = dragonPuppies[i]; if (puppy.intersects(exitDoor)) { var puppyValue = 3; // Dragons count triple puppiesSaved += puppyValue; puppiesSavedForEva += puppyValue; puppiesSavedForGabriel += puppyValue; LK.setScore(LK.getScore() + puppyValue); playerSM += 9; // 3x reward storage.playerSM = playerSM; LK.getSound('puppysaved').play(); if (!samanthaActive) { showPerversMessage(); } // Check Eva and Gabriel appearances if (currentLevel >= 5 && puppiesSavedForEva >= 6 && !samanthaActive && !evaCharacter) { puppiesSavedForEva = 0; if (Math.random() < 0.5) { spawnEva(); } } if (puppiesSavedForGabriel >= 3 && !gabrielCharacter) { puppiesSavedForGabriel = 0; if (Math.random() < 0.5) { spawnGabriel(); } } puppy.destroy(); dragonPuppies.splice(i, 1); if (selectedPuppy === puppy) { selectedPuppy = null; } updateUI(); if (puppiesSaved >= puppiesRequired) { nextLevel(); } continue; } // Dragons can be caught by Mr. Pervers if (puppy.intersects(mrPervers) && !samanthaActive && LK.ticks >= vampireSleepEndTime) { LK.setScore(LK.getScore() - 3); LK.getSound('puppycaught').play(); puppy.destroy(); dragonPuppies.splice(i, 1); if (selectedPuppy === puppy) { selectedPuppy = null; } updateUI(); } } // Check siren puppies (only catchable by Gabriel, ignored by Mr. Pervers) for (var i = sirenPuppies.length - 1; i >= 0; i--) { var puppy = sirenPuppies[i]; if (puppy.intersects(exitDoor)) { var puppyValue = 4; // Sirens count quadruple puppiesSaved += puppyValue; puppiesSavedForEva += puppyValue; puppiesSavedForGabriel += puppyValue; LK.setScore(LK.getScore() + puppyValue); playerSM += 12; // 4x reward storage.playerSM = playerSM; LK.getSound('puppysaved').play(); if (!samanthaActive) { showPerversMessage(); } // Check Eva and Gabriel appearances if (currentLevel >= 5 && puppiesSavedForEva >= 6 && !samanthaActive && !evaCharacter) { puppiesSavedForEva = 0; if (Math.random() < 0.5) { spawnEva(); } } if (puppiesSavedForGabriel >= 3 && !gabrielCharacter) { puppiesSavedForGabriel = 0; if (Math.random() < 0.5) { spawnGabriel(); } } puppy.destroy(); sirenPuppies.splice(i, 1); if (selectedPuppy === puppy) { selectedPuppy = null; } updateUI(); if (puppiesSaved >= puppiesRequired) { nextLevel(); } continue; } // Sirens can be caught by Gabriel if (gabrielCharacter && puppy.intersects(gabrielCharacter)) { puppy.destroy(); sirenPuppies.splice(i, 1); if (selectedPuppy === puppy) { selectedPuppy = null; } continue; } } // Check vampire puppies (catchable by both, but put Mr. Pervers to sleep) for (var i = vampirePuppies.length - 1; i >= 0; i--) { var puppy = vampirePuppies[i]; if (puppy.intersects(exitDoor)) { var puppyValue = 5; // Vampires count quintuple puppiesSaved += puppyValue; puppiesSavedForEva += puppyValue; puppiesSavedForGabriel += puppyValue; LK.setScore(LK.getScore() + puppyValue); playerSM += 15; // 5x reward storage.playerSM = playerSM; LK.getSound('puppysaved').play(); if (!samanthaActive) { showPerversMessage(); } // Check Eva and Gabriel appearances if (currentLevel >= 5 && puppiesSavedForEva >= 6 && !samanthaActive && !evaCharacter) { puppiesSavedForEva = 0; if (Math.random() < 0.5) { spawnEva(); } } if (puppiesSavedForGabriel >= 3 && !gabrielCharacter) { puppiesSavedForGabriel = 0; if (Math.random() < 0.5) { spawnGabriel(); } } puppy.destroy(); vampirePuppies.splice(i, 1); if (selectedPuppy === puppy) { selectedPuppy = null; } updateUI(); if (puppiesSaved >= puppiesRequired) { nextLevel(); } continue; } // Vampires can be caught by Mr. Pervers but put him to sleep if (puppy.intersects(mrPervers) && !samanthaActive && LK.ticks >= vampireSleepEndTime) { LK.setScore(LK.getScore() - 5); LK.getSound('puppycaught').play(); // Put Mr. Pervers to sleep for 2 minutes vampireSleepEndTime = LK.ticks + 2 * 60 * 60; // 2 minutes at 60 FPS mrPervers.tint = 0x808080; // Gray tint to show sleeping puppy.destroy(); vampirePuppies.splice(i, 1); if (selectedPuppy === puppy) { selectedPuppy = null; } updateUI(); continue; } // Vampires can be caught by Gabriel if (gabrielCharacter && puppy.intersects(gabrielCharacter)) { puppy.destroy(); vampirePuppies.splice(i, 1); if (selectedPuppy === puppy) { selectedPuppy = null; } continue; } } // Check legendary puppies (ignored by both, put them to sleep on collision) for (var i = legendaryPuppies.length - 1; i >= 0; i--) { var puppy = legendaryPuppies[i]; if (puppy.intersects(exitDoor)) { var puppyValue = 20; // Legendaries count as 20 puppiesSaved += puppyValue; puppiesSavedForEva += puppyValue; puppiesSavedForGabriel += puppyValue; LK.setScore(LK.getScore() + puppyValue); playerSM += 60; // 20x reward storage.playerSM = playerSM; LK.getSound('puppysaved').play(); if (!samanthaActive) { showPerversMessage(); } // Check Eva and Gabriel appearances if (currentLevel >= 5 && puppiesSavedForEva >= 6 && !samanthaActive && !evaCharacter) { puppiesSavedForEva = 0; if (Math.random() < 0.5) { spawnEva(); } } if (puppiesSavedForGabriel >= 3 && !gabrielCharacter) { puppiesSavedForGabriel = 0; if (Math.random() < 0.5) { spawnGabriel(); } } puppy.destroy(); legendaryPuppies.splice(i, 1); if (selectedPuppy === puppy) { selectedPuppy = null; } updateUI(); if (puppiesSaved >= puppiesRequired) { nextLevel(); } continue; } // Legendary puppies put Mr. Pervers to sleep on collision if (puppy.intersects(mrPervers)) { vampireSleepEndTime = LK.ticks + 10 * 60 * 60; // 10 minutes at 60 FPS mrPervers.tint = 0x808080; // Gray tint to show sleeping } // Legendary puppies put Gabriel to sleep on collision if (gabrielCharacter && puppy.intersects(gabrielCharacter)) { gabrielCharacter.destroy(); gabrielCharacter = null; } } } function updateUI() { savedText.setText('Saved: ' + puppiesSaved + '/' + puppiesRequired); scoreText.setText('Score: ' + LK.getScore()); smText.setText('SM: ' + playerSM); var displayCost = lucieDiscountActive ? Math.ceil(samanthaCost * 0.4) : samanthaCost; var costText = lucieDiscountActive ? displayCost + ' SM (60% OFF!)' : displayCost + ' SM'; invokeSamText.setText('Invoque Sam\n(' + costText + ')'); } function showPerversMessage() { // Remove existing message if any if (messageText) { messageText.destroy(); messageText = null; } // Get random message var randomMessage = perversMessages[Math.floor(Math.random() * perversMessages.length)]; // Create message text messageText = new Text2(randomMessage, { size: 80, fill: 0xFF0000 }); messageText.anchor.set(0.5, 0.5); messageText.x = 1024; messageText.y = 1200; messageText.alpha = 1; // Add to game game.addChild(messageText); // Animate message appearing with scale and fade tween(messageText, { scaleX: 1.2, scaleY: 1.2 }, { duration: 300, easing: tween.bounceOut }); // Fade out and remove after 15 seconds LK.setTimeout(function () { if (messageText) { tween(messageText, { alpha: 0 }, { duration: 1000, easing: tween.easeOut, onFinish: function onFinish() { if (messageText) { messageText.destroy(); messageText = null; } } }); } }, 15000); } function invokeSamantha() { // Apply Lucie discount if active var currentCost = lucieDiscountActive ? Math.ceil(samanthaCost * 0.4) : samanthaCost; // Deduct SM cost playerSM -= currentCost; storage.playerSM = playerSM; // Increase cost for next invocation (30% increase) samanthaCost = Math.ceil(samanthaCost * 1.3); storage.samanthaCost = samanthaCost; // Track invocations for Lucie samanthaInvocations++; // Create Samantha samanthaCharacter = game.addChild(new Samantha()); samanthaCharacter.x = 100; samanthaCharacter.y = 1000; // Set Mr. Pervers to sleep and Samantha active samanthaActive = true; samanthaEndTime = LK.ticks + 6 * 60 * 60; // 6 minutes at 60 FPS // Make Mr. Pervers sleep (stop moving and change tint) mrPervers.tint = 0x808080; // Gray tint to show sleeping // Check Lucie appearance (every 2 invocations) if (samanthaInvocations >= 2 && !lucieCharacter) { samanthaInvocations = 0; spawnLucie(); } updateUI(); } function wakeMrPervers() { samanthaActive = false; mrPervers.tint = 0xFFFFFF; // Reset tint // Remove Samantha if (samanthaCharacter) { samanthaCharacter.destroy(); samanthaCharacter = null; } } function spawnEva() { evaCharacter = game.addChild(new Eva()); evaCharacter.x = 200; evaCharacter.y = 1500; evaEndTime = LK.ticks + 15 * 60; // 15 seconds at 60 FPS // 50% chance Eva will invoke Samantha if (Math.random() < 0.5) { // Eva invokes Samantha after 2 seconds LK.setTimeout(function () { if (evaCharacter && !samanthaActive) { // Create Samantha for free samanthaCharacter = game.addChild(new Samantha()); samanthaCharacter.x = 100; samanthaCharacter.y = 1000; samanthaActive = true; samanthaEndTime = LK.ticks + 6 * 60 * 60; // 6 minutes at 60 FPS mrPervers.tint = 0x808080; // Gray tint to show sleeping // Remove Eva immediately when Samantha arrives if (evaCharacter) { evaCharacter.destroy(); evaCharacter = null; } } }, 2000); } } function spawnGabriel() { gabrielCharacter = game.addChild(new Gabriel()); gabrielCharacter.x = 1800; gabrielCharacter.y = 1000; } function spawnLucie() { lucieCharacter = game.addChild(new Lucie()); lucieCharacter.x = 1024; lucieCharacter.y = 1500; lucieActive = true; lucieEndTime = LK.ticks + 20 * 60; // 20 seconds at 60 FPS // After Lucie appears, activate 60% discount for 2 minutes LK.setTimeout(function () { if (lucieCharacter) { lucieCharacter.destroy(); lucieCharacter = null; lucieActive = false; // Activate discount lucieDiscountActive = true; lucieDiscountEndTime = LK.ticks + 2 * 60 * 60; // 2 minutes at 60 FPS updateUI(); } }, 20000); } // Vampire sleep tracking var vampireSleepEndTime = 0; function getMaxPuppiesForType(type) { switch (type) { case 'GHOST': if (currentLevel < 10) return currentLevel < 10 ? 5 : 0; return currentLevel > 10 ? 13 : 5; case 'DRAGON': if (currentLevel < 7) return 0; return currentLevel < 20 ? 6 : 15; case 'SIREN': if (currentLevel < 10) return 0; return currentLevel < 30 ? 7 : 20; case 'VAMPIRE': if (currentLevel < 15) return 0; return currentLevel < 40 ? 9 : 25; case 'LEGENDARY': if (currentLevel < 90) return 0; if (currentLevel <= 150) return 3; return 7; default: return 0; } } function isTypeAvailable(type) { switch (type) { case 'GHOST': return true; case 'DRAGON': return currentLevel >= 7; case 'SIREN': return currentLevel >= 10; case 'VAMPIRE': return currentLevel >= 15; case 'LEGENDARY': return currentLevel >= 90; default: return false; } } function openShop() { specialPuppyShop.isOpen = true; // Create shop background var shopBg = game.addChild(LK.getAsset('shopBackground', { anchorX: 0.5, anchorY: 0.5, x: 1024, y: 1366, alpha: 0.9 })); shopBg.shopElement = true; // Shop title var shopTitle = new Text2('Boutique de Chiots SpĂ©ciaux', { size: 60, fill: 0xFFFFFF }); shopTitle.anchor.set(0.5, 0.5); shopTitle.x = 1024; shopTitle.y = 800; shopTitle.shopElement = true; game.addChild(shopTitle); // Create type buttons var yPos = 1000; var buttonIndex = 0; for (var typeKey in PUPPY_TYPES) { var type = PUPPY_TYPES[typeKey]; var available = isTypeAvailable(typeKey); var maxPuppies = getMaxPuppiesForType(typeKey); var typeButton = new Container(); var buttonGraphics = typeButton.attachAsset('typeButton', { anchorX: 0.5, anchorY: 0.5 }); if (!available) { buttonGraphics.tint = 0x666666; // Gray out unavailable types } var buttonText = new Text2(type.name + '\n' + type.cost + ' SM\nMax: ' + maxPuppies, { size: 25, fill: available ? 0xFFFFFF : 0x999999 }); buttonText.anchor.set(0.5, 0.5); typeButton.addChild(buttonText); typeButton.x = 1024; typeButton.y = yPos; typeButton.shopElement = true; typeButton.typeKey = typeKey; if (available && maxPuppies > 0) { typeButton.down = function (x, y, obj) { selectPuppyType(obj.parent.typeKey); }; } game.addChild(typeButton); yPos += 120; buttonIndex++; } // Close button var closeButton = new Container(); var closeGraphics = closeButton.attachAsset('typeButton', { anchorX: 0.5, anchorY: 0.5 }); closeGraphics.tint = 0xff0000; var closeText = new Text2('Fermer', { size: 30, fill: 0xFFFFFF }); closeText.anchor.set(0.5, 0.5); closeButton.addChild(closeText); closeButton.x = 1024; closeButton.y = 1800; closeButton.shopElement = true; closeButton.down = function (x, y, obj) { closeShop(); }; game.addChild(closeButton); } function selectPuppyType(typeKey) { specialPuppyShop.selectedType = typeKey; closeShop(); openNumberSelector(typeKey); } function openNumberSelector(typeKey) { var type = PUPPY_TYPES[typeKey]; var maxPuppies = getMaxPuppiesForType(typeKey); // Create number selector background var selectorBg = game.addChild(LK.getAsset('shopBackground', { anchorX: 0.5, anchorY: 0.5, x: 1024, y: 1366, alpha: 0.9 })); selectorBg.selectorElement = true; // Title var selectorTitle = new Text2('Combien de chiots ' + type.name + '?', { size: 50, fill: 0xFFFFFF }); selectorTitle.anchor.set(0.5, 0.5); selectorTitle.x = 1024; selectorTitle.y = 900; selectorTitle.selectorElement = true; game.addChild(selectorTitle); // Current number display var currentNumber = 1; var numberDisplay = new Text2(currentNumber.toString(), { size: 80, fill: 0xFFFFFF }); numberDisplay.anchor.set(0.5, 0.5); numberDisplay.x = 1024; numberDisplay.y = 1100; numberDisplay.selectorElement = true; game.addChild(numberDisplay); // Cost display var costDisplay = new Text2('CoĂ»t: ' + currentNumber * type.cost + ' SM', { size: 40, fill: 0xFFFFFF }); costDisplay.anchor.set(0.5, 0.5); costDisplay.x = 1024; costDisplay.y = 1200; costDisplay.selectorElement = true; game.addChild(costDisplay); // Number buttons (1-9, 0) var numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0]; var startX = 1024 - 200; var startY = 1300; for (var i = 0; i < numbers.length; i++) { var num = numbers[i]; var numberButton = new Container(); var numberGraphics = numberButton.attachAsset('numberButton', { anchorX: 0.5, anchorY: 0.5 }); var numText = new Text2(num.toString(), { size: 30, fill: 0xFFFFFF }); numText.anchor.set(0.5, 0.5); numberButton.addChild(numText); numberButton.x = startX + i % 5 * 100; numberButton.y = startY + Math.floor(i / 5) * 100; numberButton.selectorElement = true; numberButton.number = num; numberButton.down = function (x, y, obj) { var digit = obj.parent.number; if (currentNumber === 0 || currentNumber.toString().length >= 2) { currentNumber = digit; } else { currentNumber = currentNumber * 10 + digit; } if (currentNumber > maxPuppies) { currentNumber = maxPuppies; } numberDisplay.setText(currentNumber.toString()); costDisplay.setText('CoĂ»t: ' + currentNumber * type.cost + ' SM'); }; game.addChild(numberButton); } // Validate button var validateButton = new Container(); var validateGraphics = validateButton.attachAsset('typeButton', { anchorX: 0.5, anchorY: 0.5 }); validateGraphics.tint = 0x00ff00; var validateText = new Text2('Valider', { size: 30, fill: 0xFFFFFF }); validateText.anchor.set(0.5, 0.5); validateButton.addChild(validateText); validateButton.x = 1024; validateButton.y = 1600; validateButton.selectorElement = true; validateButton.down = function (x, y, obj) { var totalCost = currentNumber * type.cost; if (playerSM >= totalCost && currentNumber > 0) { purchasePuppies(typeKey, currentNumber, totalCost); } closeNumberSelector(); }; game.addChild(validateButton); // Cancel button var cancelButton = new Container(); var cancelGraphics = cancelButton.attachAsset('typeButton', { anchorX: 0.5, anchorY: 0.5 }); cancelGraphics.tint = 0xff0000; var cancelText = new Text2('Annuler', { size: 30, fill: 0xFFFFFF }); cancelText.anchor.set(0.5, 0.5); cancelButton.addChild(cancelText); cancelButton.x = 1024; cancelButton.y = 1700; cancelButton.selectorElement = true; cancelButton.down = function (x, y, obj) { closeNumberSelector(); }; game.addChild(cancelButton); } function closeShop() { specialPuppyShop.isOpen = false; // Remove all shop elements for (var i = game.children.length - 1; i >= 0; i--) { var child = game.children[i]; if (child.shopElement) { child.destroy(); } } } function closeNumberSelector() { // Remove all selector elements for (var i = game.children.length - 1; i >= 0; i--) { var child = game.children[i]; if (child.selectorElement) { child.destroy(); } } } function purchasePuppies(typeKey, count, totalCost) { playerSM -= totalCost; storage.playerSM = playerSM; for (var i = 0; i < count; i++) { var puppy; switch (typeKey) { case 'GHOST': puppy = new GhostPuppy(); ghostPuppies.push(puppy); break; case 'DRAGON': puppy = new DragonPuppy(); dragonPuppies.push(puppy); break; case 'SIREN': puppy = new SirenPuppy(); sirenPuppies.push(puppy); break; case 'VAMPIRE': puppy = new VampirePuppy(); vampirePuppies.push(puppy); break; case 'LEGENDARY': puppy = new LegendaryPuppy(); legendaryPuppies.push(puppy); break; } puppy.x = Math.random() * 1500 + 300; puppy.y = Math.random() * 1000 + 800; puppy.lastX = puppy.x; puppy.lastY = puppy.y; game.addChild(puppy); } updateUI(); } function nextLevel() { currentLevel++; // Reset to level 1 if we've completed level 200 if (currentLevel > 200) { currentLevel = 1; } storage.currentLevel = currentLevel; puppiesSaved = 0; puppiesSavedForEva = 0; puppiesSavedForGabriel = 0; puppiesRequired = currentLevel === 1 ? 3 : Math.pow(2, currentLevel - 1) * 3; // Clear existing puppies for (var i = 0; i < puppies.length; i++) { puppies[i].destroy(); } puppies = []; // Clear special puppies for (var i = 0; i < ghostPuppies.length; i++) { ghostPuppies[i].destroy(); } ghostPuppies = []; for (var i = 0; i < dragonPuppies.length; i++) { dragonPuppies[i].destroy(); } dragonPuppies = []; for (var i = 0; i < sirenPuppies.length; i++) { sirenPuppies[i].destroy(); } sirenPuppies = []; for (var i = 0; i < vampirePuppies.length; i++) { vampirePuppies[i].destroy(); } vampirePuppies = []; for (var i = 0; i < legendaryPuppies.length; i++) { legendaryPuppies[i].destroy(); } legendaryPuppies = []; selectedPuppy = null; // Reset vampire sleep vampireSleepEndTime = 0; // Reset Mr. Pervers position mrPervers.x = 1024; mrPervers.y = 500; mrPervers.targetPuppy = null; // Clear all active characters if (evaCharacter) { evaCharacter.destroy(); evaCharacter = null; } if (gabrielCharacter) { gabrielCharacter.destroy(); gabrielCharacter = null; } if (lucieCharacter) { lucieCharacter.destroy(); lucieCharacter = null; lucieActive = false; } if (samanthaCharacter && !samanthaActive) { samanthaCharacter.destroy(); samanthaCharacter = null; } // Update UI levelText.setText('Level: ' + currentLevel); updateUI(); // Spawn new puppies spawnPuppies(); } // Initialize first level spawnPuppies(); // Start background music LK.playMusic('bgmusic'); game.update = function () { checkCollisions(); // Handle Samantha timer if (samanthaActive && LK.ticks >= samanthaEndTime) { wakeMrPervers(); } // Move Samantha towards Mr. Pervers if active if (samanthaActive && samanthaCharacter) { samanthaCharacter.moveTowards(mrPervers.x, mrPervers.y); } // Handle Eva timer if (evaCharacter && LK.ticks >= evaEndTime) { evaCharacter.destroy(); evaCharacter = null; } // Handle Lucie discount timer if (lucieDiscountActive && LK.ticks >= lucieDiscountEndTime) { lucieDiscountActive = false; updateUI(); } // Handle vampire sleep timer if (LK.ticks >= vampireSleepEndTime && vampireSleepEndTime > 0) { mrPervers.tint = 0xFFFFFF; // Reset tint when waking up } // Spawn new puppies if screen is empty and we haven't completed the level var totalPuppies = puppies.length + ghostPuppies.length + dragonPuppies.length + sirenPuppies.length + vampirePuppies.length + legendaryPuppies.length; if (totalPuppies === 0 && puppiesSaved < puppiesRequired) { spawnPuppies(); } };
===================================================================
--- original.js
+++ change.js
@@ -43,8 +43,73 @@
}
};
return self;
});
+var DragonPuppy = Container.expand(function () {
+ var self = Container.call(this);
+ var puppyGraphics = self.attachAsset('dragonpuppy', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ puppyGraphics.tint = 0xff4444; // Red tint for dragon
+ var puppyNames = ['Buddy', 'Max', 'Bella', 'Charlie', 'Lucy', 'Cooper', 'Luna', 'Bailey', 'Daisy', 'Rocky', 'Molly', 'Jack', 'Lola', 'Duke', 'Sadie', 'Tucker', 'Chloe', 'Bear', 'Sophie', 'Teddy', 'Roxy', 'Buster', 'Coco', 'Gus', 'Penny', 'Oscar', 'Nala', 'Milo', 'Rosie', 'Leo', 'Zoey', 'Zeus', 'Lily', 'Finn', 'Ruby', 'Ollie', 'Stella', 'Jasper', 'Ellie', 'Murphy', 'Maggie', 'Toby', 'Gracie', 'Oliver', 'Abby', 'Winston', 'Zoe', 'Bentley', 'Mia', 'Harley'];
+ self.name = puppyNames[Math.floor(Math.random() * puppyNames.length)];
+ self.isSelected = false;
+ self.moveSpeed = 8;
+ self.lastX = 0;
+ self.lastY = 0;
+ self.type = 'dragon';
+ var nameText = new Text2(self.name + ' [Dragon]', {
+ size: 35,
+ fill: 0xff4444
+ });
+ nameText.anchor.set(0.5, 0.5);
+ nameText.y = -80;
+ self.addChild(nameText);
+ self.down = function (x, y, obj) {
+ selectedPuppy = self;
+ // Clear all selections
+ for (var i = 0; i < puppies.length; i++) {
+ puppies[i].isSelected = false;
+ puppies[i].tint = 0xFFFFFF;
+ }
+ for (var i = 0; i < ghostPuppies.length; i++) {
+ ghostPuppies[i].isSelected = false;
+ ghostPuppies[i].tint = 0xFFFFFF;
+ }
+ for (var i = 0; i < dragonPuppies.length; i++) {
+ dragonPuppies[i].isSelected = false;
+ dragonPuppies[i].tint = 0xFFFFFF;
+ }
+ for (var i = 0; i < sirenPuppies.length; i++) {
+ sirenPuppies[i].isSelected = false;
+ sirenPuppies[i].tint = 0xFFFFFF;
+ }
+ for (var i = 0; i < vampirePuppies.length; i++) {
+ vampirePuppies[i].isSelected = false;
+ vampirePuppies[i].tint = 0xFFFFFF;
+ }
+ for (var i = 0; i < legendaryPuppies.length; i++) {
+ legendaryPuppies[i].isSelected = false;
+ legendaryPuppies[i].tint = 0xFFFFFF;
+ }
+ self.isSelected = true;
+ self.tint = 0xFFFF00;
+ };
+ self.moveTowards = function (targetX, targetY) {
+ var dx = targetX - self.x;
+ var dy = targetY - self.y;
+ var distance = Math.sqrt(dx * dx + dy * dy);
+ if (distance > self.moveSpeed) {
+ self.x += dx / distance * self.moveSpeed;
+ self.y += dy / distance * self.moveSpeed;
+ } else {
+ self.x = targetX;
+ self.y = targetY;
+ }
+ };
+ return self;
+});
var Eva = Container.expand(function () {
var self = Container.call(this);
var evaGraphics = self.attachAsset('eva', {
anchorX: 0.5,
@@ -89,8 +154,139 @@
}
};
return self;
});
+var GhostPuppy = Container.expand(function () {
+ var self = Container.call(this);
+ var puppyGraphics = self.attachAsset('ghostpuppy', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ puppyGraphics.alpha = 0.7; // Semi-transparent for ghost effect
+ var puppyNames = ['Buddy', 'Max', 'Bella', 'Charlie', 'Lucy', 'Cooper', 'Luna', 'Bailey', 'Daisy', 'Rocky', 'Molly', 'Jack', 'Lola', 'Duke', 'Sadie', 'Tucker', 'Chloe', 'Bear', 'Sophie', 'Teddy', 'Roxy', 'Buster', 'Coco', 'Gus', 'Penny', 'Oscar', 'Nala', 'Milo', 'Rosie', 'Leo', 'Zoey', 'Zeus', 'Lily', 'Finn', 'Ruby', 'Ollie', 'Stella', 'Jasper', 'Ellie', 'Murphy', 'Maggie', 'Toby', 'Gracie', 'Oliver', 'Abby', 'Winston', 'Zoe', 'Bentley', 'Mia', 'Harley'];
+ self.name = puppyNames[Math.floor(Math.random() * puppyNames.length)];
+ self.age = Math.floor(Math.random() * 20) + 1; // Random age between 1-20 months
+ self.isSelected = false;
+ self.moveSpeed = 8;
+ self.lastX = 0;
+ self.lastY = 0;
+ self.type = 'ghost';
+ var nameText = new Text2(self.name + ' (' + self.age + ' mois) [FantĂŽme]', {
+ size: 35,
+ fill: 0x9999ff
+ });
+ nameText.anchor.set(0.5, 0.5);
+ nameText.y = -80;
+ self.addChild(nameText);
+ self.down = function (x, y, obj) {
+ selectedPuppy = self;
+ // Clear all selections
+ for (var i = 0; i < puppies.length; i++) {
+ puppies[i].isSelected = false;
+ puppies[i].tint = 0xFFFFFF;
+ }
+ for (var i = 0; i < ghostPuppies.length; i++) {
+ ghostPuppies[i].isSelected = false;
+ ghostPuppies[i].tint = 0xFFFFFF;
+ }
+ for (var i = 0; i < dragonPuppies.length; i++) {
+ dragonPuppies[i].isSelected = false;
+ dragonPuppies[i].tint = 0xFFFFFF;
+ }
+ for (var i = 0; i < sirenPuppies.length; i++) {
+ sirenPuppies[i].isSelected = false;
+ sirenPuppies[i].tint = 0xFFFFFF;
+ }
+ for (var i = 0; i < vampirePuppies.length; i++) {
+ vampirePuppies[i].isSelected = false;
+ vampirePuppies[i].tint = 0xFFFFFF;
+ }
+ for (var i = 0; i < legendaryPuppies.length; i++) {
+ legendaryPuppies[i].isSelected = false;
+ legendaryPuppies[i].tint = 0xFFFFFF;
+ }
+ self.isSelected = true;
+ self.tint = 0xFFFF00;
+ };
+ self.moveTowards = function (targetX, targetY) {
+ var dx = targetX - self.x;
+ var dy = targetY - self.y;
+ var distance = Math.sqrt(dx * dx + dy * dy);
+ if (distance > self.moveSpeed) {
+ self.x += dx / distance * self.moveSpeed;
+ self.y += dy / distance * self.moveSpeed;
+ } else {
+ self.x = targetX;
+ self.y = targetY;
+ }
+ };
+ return self;
+});
+var LegendaryPuppy = Container.expand(function () {
+ var self = Container.call(this);
+ var puppyGraphics = self.attachAsset('legendarypuppy', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ puppyGraphics.tint = 0xFFD700; // Gold tint for legendary
+ var puppyNames = ['Buddy', 'Max', 'Bella', 'Charlie', 'Lucy', 'Cooper', 'Luna', 'Bailey', 'Daisy', 'Rocky', 'Molly', 'Jack', 'Lola', 'Duke', 'Sadie', 'Tucker', 'Chloe', 'Bear', 'Sophie', 'Teddy', 'Roxy', 'Buster', 'Coco', 'Gus', 'Penny', 'Oscar', 'Nala', 'Milo', 'Rosie', 'Leo', 'Zoey', 'Zeus', 'Lily', 'Finn', 'Ruby', 'Ollie', 'Stella', 'Jasper', 'Ellie', 'Murphy', 'Maggie', 'Toby', 'Gracie', 'Oliver', 'Abby', 'Winston', 'Zoe', 'Bentley', 'Mia', 'Harley'];
+ self.name = puppyNames[Math.floor(Math.random() * puppyNames.length)];
+ self.isSelected = false;
+ self.moveSpeed = 8;
+ self.lastX = 0;
+ self.lastY = 0;
+ self.type = 'legendary';
+ var nameText = new Text2(self.name + ' [LĂGENDAIRE]', {
+ size: 35,
+ fill: 0xFFD700
+ });
+ nameText.anchor.set(0.5, 0.5);
+ nameText.y = -80;
+ self.addChild(nameText);
+ self.down = function (x, y, obj) {
+ selectedPuppy = self;
+ // Clear all selections
+ for (var i = 0; i < puppies.length; i++) {
+ puppies[i].isSelected = false;
+ puppies[i].tint = 0xFFFFFF;
+ }
+ for (var i = 0; i < ghostPuppies.length; i++) {
+ ghostPuppies[i].isSelected = false;
+ ghostPuppies[i].tint = 0xFFFFFF;
+ }
+ for (var i = 0; i < dragonPuppies.length; i++) {
+ dragonPuppies[i].isSelected = false;
+ dragonPuppies[i].tint = 0xFFFFFF;
+ }
+ for (var i = 0; i < sirenPuppies.length; i++) {
+ sirenPuppies[i].isSelected = false;
+ sirenPuppies[i].tint = 0xFFFFFF;
+ }
+ for (var i = 0; i < vampirePuppies.length; i++) {
+ vampirePuppies[i].isSelected = false;
+ vampirePuppies[i].tint = 0xFFFFFF;
+ }
+ for (var i = 0; i < legendaryPuppies.length; i++) {
+ legendaryPuppies[i].isSelected = false;
+ legendaryPuppies[i].tint = 0xFFFFFF;
+ }
+ self.isSelected = true;
+ self.tint = 0xFFFF00;
+ };
+ self.moveTowards = function (targetX, targetY) {
+ var dx = targetX - self.x;
+ var dy = targetY - self.y;
+ var distance = Math.sqrt(dx * dx + dy * dy);
+ if (distance > self.moveSpeed) {
+ self.x += dx / distance * self.moveSpeed;
+ self.y += dy / distance * self.moveSpeed;
+ } else {
+ self.x = targetX;
+ self.y = targetY;
+ }
+ };
+ return self;
+});
var Lucie = Container.expand(function () {
var self = Container.call(this);
var lucieGraphics = self.attachAsset('lucie', {
anchorX: 0.5,
@@ -213,8 +409,138 @@
}
};
return self;
});
+var SirenPuppy = Container.expand(function () {
+ var self = Container.call(this);
+ var puppyGraphics = self.attachAsset('sirenpuppy', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ puppyGraphics.tint = 0x44ffff; // Cyan tint for siren
+ var puppyNames = ['Buddy', 'Max', 'Bella', 'Charlie', 'Lucy', 'Cooper', 'Luna', 'Bailey', 'Daisy', 'Rocky', 'Molly', 'Jack', 'Lola', 'Duke', 'Sadie', 'Tucker', 'Chloe', 'Bear', 'Sophie', 'Teddy', 'Roxy', 'Buster', 'Coco', 'Gus', 'Penny', 'Oscar', 'Nala', 'Milo', 'Rosie', 'Leo', 'Zoey', 'Zeus', 'Lily', 'Finn', 'Ruby', 'Ollie', 'Stella', 'Jasper', 'Ellie', 'Murphy', 'Maggie', 'Toby', 'Gracie', 'Oliver', 'Abby', 'Winston', 'Zoe', 'Bentley', 'Mia', 'Harley'];
+ self.name = puppyNames[Math.floor(Math.random() * puppyNames.length)];
+ self.isSelected = false;
+ self.moveSpeed = 8;
+ self.lastX = 0;
+ self.lastY = 0;
+ self.type = 'siren';
+ var nameText = new Text2(self.name + ' [SirĂšne]', {
+ size: 35,
+ fill: 0x44ffff
+ });
+ nameText.anchor.set(0.5, 0.5);
+ nameText.y = -80;
+ self.addChild(nameText);
+ self.down = function (x, y, obj) {
+ selectedPuppy = self;
+ // Clear all selections
+ for (var i = 0; i < puppies.length; i++) {
+ puppies[i].isSelected = false;
+ puppies[i].tint = 0xFFFFFF;
+ }
+ for (var i = 0; i < ghostPuppies.length; i++) {
+ ghostPuppies[i].isSelected = false;
+ ghostPuppies[i].tint = 0xFFFFFF;
+ }
+ for (var i = 0; i < dragonPuppies.length; i++) {
+ dragonPuppies[i].isSelected = false;
+ dragonPuppies[i].tint = 0xFFFFFF;
+ }
+ for (var i = 0; i < sirenPuppies.length; i++) {
+ sirenPuppies[i].isSelected = false;
+ sirenPuppies[i].tint = 0xFFFFFF;
+ }
+ for (var i = 0; i < vampirePuppies.length; i++) {
+ vampirePuppies[i].isSelected = false;
+ vampirePuppies[i].tint = 0xFFFFFF;
+ }
+ for (var i = 0; i < legendaryPuppies.length; i++) {
+ legendaryPuppies[i].isSelected = false;
+ legendaryPuppies[i].tint = 0xFFFFFF;
+ }
+ self.isSelected = true;
+ self.tint = 0xFFFF00;
+ };
+ self.moveTowards = function (targetX, targetY) {
+ var dx = targetX - self.x;
+ var dy = targetY - self.y;
+ var distance = Math.sqrt(dx * dx + dy * dy);
+ if (distance > self.moveSpeed) {
+ self.x += dx / distance * self.moveSpeed;
+ self.y += dy / distance * self.moveSpeed;
+ } else {
+ self.x = targetX;
+ self.y = targetY;
+ }
+ };
+ return self;
+});
+var VampirePuppy = Container.expand(function () {
+ var self = Container.call(this);
+ var puppyGraphics = self.attachAsset('vampirepuppy', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ puppyGraphics.tint = 0x800080; // Purple tint for vampire
+ var puppyNames = ['Buddy', 'Max', 'Bella', 'Charlie', 'Lucy', 'Cooper', 'Luna', 'Bailey', 'Daisy', 'Rocky', 'Molly', 'Jack', 'Lola', 'Duke', 'Sadie', 'Tucker', 'Chloe', 'Bear', 'Sophie', 'Teddy', 'Roxy', 'Buster', 'Coco', 'Gus', 'Penny', 'Oscar', 'Nala', 'Milo', 'Rosie', 'Leo', 'Zoey', 'Zeus', 'Lily', 'Finn', 'Ruby', 'Ollie', 'Stella', 'Jasper', 'Ellie', 'Murphy', 'Maggie', 'Toby', 'Gracie', 'Oliver', 'Abby', 'Winston', 'Zoe', 'Bentley', 'Mia', 'Harley'];
+ self.name = puppyNames[Math.floor(Math.random() * puppyNames.length)];
+ self.isSelected = false;
+ self.moveSpeed = 8;
+ self.lastX = 0;
+ self.lastY = 0;
+ self.type = 'vampire';
+ var nameText = new Text2(self.name + ' [Vampire]', {
+ size: 35,
+ fill: 0x800080
+ });
+ nameText.anchor.set(0.5, 0.5);
+ nameText.y = -80;
+ self.addChild(nameText);
+ self.down = function (x, y, obj) {
+ selectedPuppy = self;
+ // Clear all selections
+ for (var i = 0; i < puppies.length; i++) {
+ puppies[i].isSelected = false;
+ puppies[i].tint = 0xFFFFFF;
+ }
+ for (var i = 0; i < ghostPuppies.length; i++) {
+ ghostPuppies[i].isSelected = false;
+ ghostPuppies[i].tint = 0xFFFFFF;
+ }
+ for (var i = 0; i < dragonPuppies.length; i++) {
+ dragonPuppies[i].isSelected = false;
+ dragonPuppies[i].tint = 0xFFFFFF;
+ }
+ for (var i = 0; i < sirenPuppies.length; i++) {
+ sirenPuppies[i].isSelected = false;
+ sirenPuppies[i].tint = 0xFFFFFF;
+ }
+ for (var i = 0; i < vampirePuppies.length; i++) {
+ vampirePuppies[i].isSelected = false;
+ vampirePuppies[i].tint = 0xFFFFFF;
+ }
+ for (var i = 0; i < legendaryPuppies.length; i++) {
+ legendaryPuppies[i].isSelected = false;
+ legendaryPuppies[i].tint = 0xFFFFFF;
+ }
+ self.isSelected = true;
+ self.tint = 0xFFFF00;
+ };
+ self.moveTowards = function (targetX, targetY) {
+ var dx = targetX - self.x;
+ var dy = targetY - self.y;
+ var distance = Math.sqrt(dx * dx + dy * dy);
+ if (distance > self.moveSpeed) {
+ self.x += dx / distance * self.moveSpeed;
+ self.y += dy / distance * self.moveSpeed;
+ } else {
+ self.x = targetX;
+ self.y = targetY;
+ }
+ };
+ return self;
+});
/****
* Initialize Game
****/
@@ -258,8 +584,52 @@
var lucieActive = false;
var lucieEndTime = 0;
var lucieDiscountActive = false;
var lucieDiscountEndTime = 0;
+// Special puppy shop system
+var specialPuppyShop = {
+ isOpen: false,
+ selectedType: null
+};
+// Special puppy types and costs
+var PUPPY_TYPES = {
+ GHOST: {
+ name: 'FantĂŽmes',
+ cost: 6,
+ multiplier: 1,
+ hasAge: true
+ },
+ DRAGON: {
+ name: 'Dragons',
+ cost: 15,
+ multiplier: 3,
+ hasAge: false
+ },
+ SIREN: {
+ name: 'SirĂšnes',
+ cost: 25,
+ multiplier: 4,
+ hasAge: false
+ },
+ VAMPIRE: {
+ name: 'Vampires',
+ cost: 50,
+ multiplier: 5,
+ hasAge: false
+ },
+ LEGENDARY: {
+ name: 'Légendaires',
+ cost: 1000,
+ multiplier: 20,
+ hasAge: false
+ }
+};
+// Special puppies arrays
+var ghostPuppies = [];
+var dragonPuppies = [];
+var sirenPuppies = [];
+var vampirePuppies = [];
+var legendaryPuppies = [];
// Mr. Pervers mean messages
var perversMessages = ["NON! Mes hot dogs de chiot!", "Ce chiot Ă©tait parfait pour ma saucisse!", "Tu ruines mon menu hot dog!", "J'avais prĂ©vu de le servir grillĂ©!", "Mes clients voulaient ce hot dog!", "Cette viande de chiot Ă©tait premium!", "Tu gĂąches ma spĂ©cialitĂ© hot dog!", "Ce chiot aurait fait un dĂ©licieux hot dog!", "Mes hot dogs de chiot sont cĂ©lĂšbres!", "Tu m'empĂȘches de cuisiner mes hot dogs!", "Ce chiot Ă©tait destinĂ© Ă ma marmite!", "Mes hot dogs seront moins savoureux!", "Tu voles mes ingrĂ©dients Ă hot dog!", "Ce chiot Ă©tait ma recette secrĂšte!", "Mes clients adorent mes hot dogs de chiot!", "Tu sabotes ma production de hot dogs!", "Cette viande Ă©tait parfaite pour griller!", "Mes hot dogs de chiot sont uniques!", "Tu dĂ©truis mon business de hot dogs!", "Ce chiot aurait nourri mes clients!", "Ma spĂ©cialitĂ© hot dog est ruinĂ©e!", "Tu m'empĂȘches de servir mes hot dogs!", "Cette viande de chiot Ă©tait fraĂźche!", "Mes hot dogs perdent leur goĂ»t!", "Tu voles ma matiĂšre premiĂšre!", "Ce chiot Ă©tait mon meilleur ingrĂ©dient!", "Mes hot dogs de chiot sont ma fiertĂ©!", "Tu ruines ma rĂ©putation de hot dogs!", "Cette viande Ă©tait prĂȘte Ă cuire!", "Mes clients vont ĂȘtre déçus!", "Tu gĂąches ma recette de hot dog!", "Ce chiot Ă©tait parfait pour les saucisses!", "Mes hot dogs de chiot sont artistiques!", "Tu m'empĂȘches de nourrir mes clients!", "Cette viande aurait Ă©tĂ© dĂ©licieuse!", "Mes hot dogs perdent leur originalitĂ©!", "Tu sabotes ma cuisine de hot dogs!", "Ce chiot Ă©tait ma fortune culinaire!", "Mes hot dogs de chiot sont lĂ©gendaires!", "Tu dĂ©truis mon art du hot dog!", "Cette viande Ă©tait mon inspiration!", "Mes hot dogs ne seront plus pareils!", "Tu voles mes profits de hot dogs!", "Ce chiot Ă©tait destinĂ© au grill!", "Mes hot dogs de chiot sont ma passion!", "Tu ruines mes ventes de hot dogs!", "Cette viande Ă©tait exceptionnelle!", "Mes hot dogs perdent leur magie!", "Tu gĂąches ma tradition culinaire!", "Ce chiot Ă©tait mon chef-d'Ćuvre!", "Mes hot dogs de chiot sont irremplaçables!", "Tu m'empĂȘches de rĂ©galer mes clients!", "Cette viande Ă©tait ma signature!", "Mes hot dogs perdent leur authenticitĂ©!", "Tu sabotes mon empire hot dog!", "Ce chiot Ă©tait mon trĂ©sor culinaire!", "Mes hot dogs de chiot sont mon hĂ©ritage!", "Tu dĂ©truis ma chaĂźne de restaurants!", "Cette viande Ă©tait ma spĂ©cialitĂ©!", "Mes hot dogs ne seront plus uniques!", "Tu voles mon succĂšs culinaire!", "Ce chiot Ă©tait parfait pour mes saucisses!", "Mes hot dogs de chiot sont ma vie!", "Tu ruines mes rĂȘves de restaurateur!", "Cette viande Ă©tait mon avenir!", "Mes hot dogs perdent leur saveur!", "Tu gĂąches ma rĂ©putation mondiale!", "Ce chiot Ă©tait destinĂ© Ă mes clients!", "Mes hot dogs de chiot sont mon gĂ©nie!", "Tu m'empĂȘches de devenir riche!", "Cette viande Ă©tait ma rĂ©volution!", "Mes hot dogs ne seront plus parfaits!", "Tu sabotes mon innovation culinaire!", "Ce chiot Ă©tait mon diamant brut!", "Mes hot dogs de chiot sont mon destin!", "Tu dĂ©truis mon rĂȘve amĂ©ricain!"];
var messageText = null;
// UI elements
@@ -363,8 +733,28 @@
invokeSamantha();
}
};
game.addChild(invokeSamButton);
+// Shop button
+var shopButton = new Container();
+var shopGraphics = shopButton.attachAsset('shopButton', {
+ anchorX: 0.5,
+ anchorY: 0.5
+});
+var shopText = new Text2('Boutique', {
+ size: 30,
+ fill: 0x000000
+});
+shopText.anchor.set(0.5, 0.5);
+shopButton.addChild(shopText);
+shopButton.x = 500;
+shopButton.y = 2300;
+shopButton.down = function (x, y, obj) {
+ if (!specialPuppyShop.isOpen) {
+ openShop();
+ }
+};
+game.addChild(shopButton);
// Functions
function spawnPuppies() {
var numPuppies = 1;
if (currentLevel >= 11) {
@@ -382,8 +772,9 @@
game.addChild(puppy);
}
}
function checkCollisions() {
+ // Check normal puppies
for (var i = puppies.length - 1; i >= 0; i--) {
var puppy = puppies[i];
// Check if puppy reached exit
if (puppy.intersects(exitDoor)) {
@@ -426,9 +817,9 @@
}
continue;
}
// Check if puppy caught by Mr. Pervers (only if Mr. Pervers is not sleeping)
- if (puppy.intersects(mrPervers) && !samanthaActive) {
+ if (puppy.intersects(mrPervers) && !samanthaActive && LK.ticks >= vampireSleepEndTime) {
LK.setScore(LK.getScore() - 1);
LK.getSound('puppycaught').play();
puppy.destroy();
puppies.splice(i, 1);
@@ -449,8 +840,261 @@
}
continue;
}
}
+ // Check ghost puppies (ignored by Mr. Pervers and Gabriel)
+ for (var i = ghostPuppies.length - 1; i >= 0; i--) {
+ var puppy = ghostPuppies[i];
+ if (puppy.intersects(exitDoor)) {
+ var puppyValue = puppy.age > 10 ? 2 : 1;
+ puppiesSaved += puppyValue;
+ puppiesSavedForEva += puppyValue;
+ puppiesSavedForGabriel += puppyValue;
+ LK.setScore(LK.getScore() + puppyValue);
+ playerSM += 3;
+ storage.playerSM = playerSM;
+ LK.getSound('puppysaved').play();
+ if (!samanthaActive) {
+ showPerversMessage();
+ }
+ // Check Eva and Gabriel appearances
+ if (currentLevel >= 5 && puppiesSavedForEva >= 6 && !samanthaActive && !evaCharacter) {
+ puppiesSavedForEva = 0;
+ if (Math.random() < 0.5) {
+ spawnEva();
+ }
+ }
+ if (puppiesSavedForGabriel >= 3 && !gabrielCharacter) {
+ puppiesSavedForGabriel = 0;
+ if (Math.random() < 0.5) {
+ spawnGabriel();
+ }
+ }
+ puppy.destroy();
+ ghostPuppies.splice(i, 1);
+ if (selectedPuppy === puppy) {
+ selectedPuppy = null;
+ }
+ updateUI();
+ if (puppiesSaved >= puppiesRequired) {
+ nextLevel();
+ }
+ }
+ }
+ // Check dragon puppies (only catchable by Mr. Pervers, ignored by Gabriel)
+ for (var i = dragonPuppies.length - 1; i >= 0; i--) {
+ var puppy = dragonPuppies[i];
+ if (puppy.intersects(exitDoor)) {
+ var puppyValue = 3; // Dragons count triple
+ puppiesSaved += puppyValue;
+ puppiesSavedForEva += puppyValue;
+ puppiesSavedForGabriel += puppyValue;
+ LK.setScore(LK.getScore() + puppyValue);
+ playerSM += 9; // 3x reward
+ storage.playerSM = playerSM;
+ LK.getSound('puppysaved').play();
+ if (!samanthaActive) {
+ showPerversMessage();
+ }
+ // Check Eva and Gabriel appearances
+ if (currentLevel >= 5 && puppiesSavedForEva >= 6 && !samanthaActive && !evaCharacter) {
+ puppiesSavedForEva = 0;
+ if (Math.random() < 0.5) {
+ spawnEva();
+ }
+ }
+ if (puppiesSavedForGabriel >= 3 && !gabrielCharacter) {
+ puppiesSavedForGabriel = 0;
+ if (Math.random() < 0.5) {
+ spawnGabriel();
+ }
+ }
+ puppy.destroy();
+ dragonPuppies.splice(i, 1);
+ if (selectedPuppy === puppy) {
+ selectedPuppy = null;
+ }
+ updateUI();
+ if (puppiesSaved >= puppiesRequired) {
+ nextLevel();
+ }
+ continue;
+ }
+ // Dragons can be caught by Mr. Pervers
+ if (puppy.intersects(mrPervers) && !samanthaActive && LK.ticks >= vampireSleepEndTime) {
+ LK.setScore(LK.getScore() - 3);
+ LK.getSound('puppycaught').play();
+ puppy.destroy();
+ dragonPuppies.splice(i, 1);
+ if (selectedPuppy === puppy) {
+ selectedPuppy = null;
+ }
+ updateUI();
+ }
+ }
+ // Check siren puppies (only catchable by Gabriel, ignored by Mr. Pervers)
+ for (var i = sirenPuppies.length - 1; i >= 0; i--) {
+ var puppy = sirenPuppies[i];
+ if (puppy.intersects(exitDoor)) {
+ var puppyValue = 4; // Sirens count quadruple
+ puppiesSaved += puppyValue;
+ puppiesSavedForEva += puppyValue;
+ puppiesSavedForGabriel += puppyValue;
+ LK.setScore(LK.getScore() + puppyValue);
+ playerSM += 12; // 4x reward
+ storage.playerSM = playerSM;
+ LK.getSound('puppysaved').play();
+ if (!samanthaActive) {
+ showPerversMessage();
+ }
+ // Check Eva and Gabriel appearances
+ if (currentLevel >= 5 && puppiesSavedForEva >= 6 && !samanthaActive && !evaCharacter) {
+ puppiesSavedForEva = 0;
+ if (Math.random() < 0.5) {
+ spawnEva();
+ }
+ }
+ if (puppiesSavedForGabriel >= 3 && !gabrielCharacter) {
+ puppiesSavedForGabriel = 0;
+ if (Math.random() < 0.5) {
+ spawnGabriel();
+ }
+ }
+ puppy.destroy();
+ sirenPuppies.splice(i, 1);
+ if (selectedPuppy === puppy) {
+ selectedPuppy = null;
+ }
+ updateUI();
+ if (puppiesSaved >= puppiesRequired) {
+ nextLevel();
+ }
+ continue;
+ }
+ // Sirens can be caught by Gabriel
+ if (gabrielCharacter && puppy.intersects(gabrielCharacter)) {
+ puppy.destroy();
+ sirenPuppies.splice(i, 1);
+ if (selectedPuppy === puppy) {
+ selectedPuppy = null;
+ }
+ continue;
+ }
+ }
+ // Check vampire puppies (catchable by both, but put Mr. Pervers to sleep)
+ for (var i = vampirePuppies.length - 1; i >= 0; i--) {
+ var puppy = vampirePuppies[i];
+ if (puppy.intersects(exitDoor)) {
+ var puppyValue = 5; // Vampires count quintuple
+ puppiesSaved += puppyValue;
+ puppiesSavedForEva += puppyValue;
+ puppiesSavedForGabriel += puppyValue;
+ LK.setScore(LK.getScore() + puppyValue);
+ playerSM += 15; // 5x reward
+ storage.playerSM = playerSM;
+ LK.getSound('puppysaved').play();
+ if (!samanthaActive) {
+ showPerversMessage();
+ }
+ // Check Eva and Gabriel appearances
+ if (currentLevel >= 5 && puppiesSavedForEva >= 6 && !samanthaActive && !evaCharacter) {
+ puppiesSavedForEva = 0;
+ if (Math.random() < 0.5) {
+ spawnEva();
+ }
+ }
+ if (puppiesSavedForGabriel >= 3 && !gabrielCharacter) {
+ puppiesSavedForGabriel = 0;
+ if (Math.random() < 0.5) {
+ spawnGabriel();
+ }
+ }
+ puppy.destroy();
+ vampirePuppies.splice(i, 1);
+ if (selectedPuppy === puppy) {
+ selectedPuppy = null;
+ }
+ updateUI();
+ if (puppiesSaved >= puppiesRequired) {
+ nextLevel();
+ }
+ continue;
+ }
+ // Vampires can be caught by Mr. Pervers but put him to sleep
+ if (puppy.intersects(mrPervers) && !samanthaActive && LK.ticks >= vampireSleepEndTime) {
+ LK.setScore(LK.getScore() - 5);
+ LK.getSound('puppycaught').play();
+ // Put Mr. Pervers to sleep for 2 minutes
+ vampireSleepEndTime = LK.ticks + 2 * 60 * 60; // 2 minutes at 60 FPS
+ mrPervers.tint = 0x808080; // Gray tint to show sleeping
+ puppy.destroy();
+ vampirePuppies.splice(i, 1);
+ if (selectedPuppy === puppy) {
+ selectedPuppy = null;
+ }
+ updateUI();
+ continue;
+ }
+ // Vampires can be caught by Gabriel
+ if (gabrielCharacter && puppy.intersects(gabrielCharacter)) {
+ puppy.destroy();
+ vampirePuppies.splice(i, 1);
+ if (selectedPuppy === puppy) {
+ selectedPuppy = null;
+ }
+ continue;
+ }
+ }
+ // Check legendary puppies (ignored by both, put them to sleep on collision)
+ for (var i = legendaryPuppies.length - 1; i >= 0; i--) {
+ var puppy = legendaryPuppies[i];
+ if (puppy.intersects(exitDoor)) {
+ var puppyValue = 20; // Legendaries count as 20
+ puppiesSaved += puppyValue;
+ puppiesSavedForEva += puppyValue;
+ puppiesSavedForGabriel += puppyValue;
+ LK.setScore(LK.getScore() + puppyValue);
+ playerSM += 60; // 20x reward
+ storage.playerSM = playerSM;
+ LK.getSound('puppysaved').play();
+ if (!samanthaActive) {
+ showPerversMessage();
+ }
+ // Check Eva and Gabriel appearances
+ if (currentLevel >= 5 && puppiesSavedForEva >= 6 && !samanthaActive && !evaCharacter) {
+ puppiesSavedForEva = 0;
+ if (Math.random() < 0.5) {
+ spawnEva();
+ }
+ }
+ if (puppiesSavedForGabriel >= 3 && !gabrielCharacter) {
+ puppiesSavedForGabriel = 0;
+ if (Math.random() < 0.5) {
+ spawnGabriel();
+ }
+ }
+ puppy.destroy();
+ legendaryPuppies.splice(i, 1);
+ if (selectedPuppy === puppy) {
+ selectedPuppy = null;
+ }
+ updateUI();
+ if (puppiesSaved >= puppiesRequired) {
+ nextLevel();
+ }
+ continue;
+ }
+ // Legendary puppies put Mr. Pervers to sleep on collision
+ if (puppy.intersects(mrPervers)) {
+ vampireSleepEndTime = LK.ticks + 10 * 60 * 60; // 10 minutes at 60 FPS
+ mrPervers.tint = 0x808080; // Gray tint to show sleeping
+ }
+ // Legendary puppies put Gabriel to sleep on collision
+ if (gabrielCharacter && puppy.intersects(gabrielCharacter)) {
+ gabrielCharacter.destroy();
+ gabrielCharacter = null;
+ }
+ }
}
function updateUI() {
savedText.setText('Saved: ' + puppiesSaved + '/' + puppiesRequired);
scoreText.setText('Score: ' + LK.getScore());
@@ -589,8 +1233,307 @@
updateUI();
}
}, 20000);
}
+// Vampire sleep tracking
+var vampireSleepEndTime = 0;
+function getMaxPuppiesForType(type) {
+ switch (type) {
+ case 'GHOST':
+ if (currentLevel < 10) return currentLevel < 10 ? 5 : 0;
+ return currentLevel > 10 ? 13 : 5;
+ case 'DRAGON':
+ if (currentLevel < 7) return 0;
+ return currentLevel < 20 ? 6 : 15;
+ case 'SIREN':
+ if (currentLevel < 10) return 0;
+ return currentLevel < 30 ? 7 : 20;
+ case 'VAMPIRE':
+ if (currentLevel < 15) return 0;
+ return currentLevel < 40 ? 9 : 25;
+ case 'LEGENDARY':
+ if (currentLevel < 90) return 0;
+ if (currentLevel <= 150) return 3;
+ return 7;
+ default:
+ return 0;
+ }
+}
+function isTypeAvailable(type) {
+ switch (type) {
+ case 'GHOST':
+ return true;
+ case 'DRAGON':
+ return currentLevel >= 7;
+ case 'SIREN':
+ return currentLevel >= 10;
+ case 'VAMPIRE':
+ return currentLevel >= 15;
+ case 'LEGENDARY':
+ return currentLevel >= 90;
+ default:
+ return false;
+ }
+}
+function openShop() {
+ specialPuppyShop.isOpen = true;
+ // Create shop background
+ var shopBg = game.addChild(LK.getAsset('shopBackground', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 1024,
+ y: 1366,
+ alpha: 0.9
+ }));
+ shopBg.shopElement = true;
+ // Shop title
+ var shopTitle = new Text2('Boutique de Chiots Spéciaux', {
+ size: 60,
+ fill: 0xFFFFFF
+ });
+ shopTitle.anchor.set(0.5, 0.5);
+ shopTitle.x = 1024;
+ shopTitle.y = 800;
+ shopTitle.shopElement = true;
+ game.addChild(shopTitle);
+ // Create type buttons
+ var yPos = 1000;
+ var buttonIndex = 0;
+ for (var typeKey in PUPPY_TYPES) {
+ var type = PUPPY_TYPES[typeKey];
+ var available = isTypeAvailable(typeKey);
+ var maxPuppies = getMaxPuppiesForType(typeKey);
+ var typeButton = new Container();
+ var buttonGraphics = typeButton.attachAsset('typeButton', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ if (!available) {
+ buttonGraphics.tint = 0x666666; // Gray out unavailable types
+ }
+ var buttonText = new Text2(type.name + '\n' + type.cost + ' SM\nMax: ' + maxPuppies, {
+ size: 25,
+ fill: available ? 0xFFFFFF : 0x999999
+ });
+ buttonText.anchor.set(0.5, 0.5);
+ typeButton.addChild(buttonText);
+ typeButton.x = 1024;
+ typeButton.y = yPos;
+ typeButton.shopElement = true;
+ typeButton.typeKey = typeKey;
+ if (available && maxPuppies > 0) {
+ typeButton.down = function (x, y, obj) {
+ selectPuppyType(obj.parent.typeKey);
+ };
+ }
+ game.addChild(typeButton);
+ yPos += 120;
+ buttonIndex++;
+ }
+ // Close button
+ var closeButton = new Container();
+ var closeGraphics = closeButton.attachAsset('typeButton', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ closeGraphics.tint = 0xff0000;
+ var closeText = new Text2('Fermer', {
+ size: 30,
+ fill: 0xFFFFFF
+ });
+ closeText.anchor.set(0.5, 0.5);
+ closeButton.addChild(closeText);
+ closeButton.x = 1024;
+ closeButton.y = 1800;
+ closeButton.shopElement = true;
+ closeButton.down = function (x, y, obj) {
+ closeShop();
+ };
+ game.addChild(closeButton);
+}
+function selectPuppyType(typeKey) {
+ specialPuppyShop.selectedType = typeKey;
+ closeShop();
+ openNumberSelector(typeKey);
+}
+function openNumberSelector(typeKey) {
+ var type = PUPPY_TYPES[typeKey];
+ var maxPuppies = getMaxPuppiesForType(typeKey);
+ // Create number selector background
+ var selectorBg = game.addChild(LK.getAsset('shopBackground', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 1024,
+ y: 1366,
+ alpha: 0.9
+ }));
+ selectorBg.selectorElement = true;
+ // Title
+ var selectorTitle = new Text2('Combien de chiots ' + type.name + '?', {
+ size: 50,
+ fill: 0xFFFFFF
+ });
+ selectorTitle.anchor.set(0.5, 0.5);
+ selectorTitle.x = 1024;
+ selectorTitle.y = 900;
+ selectorTitle.selectorElement = true;
+ game.addChild(selectorTitle);
+ // Current number display
+ var currentNumber = 1;
+ var numberDisplay = new Text2(currentNumber.toString(), {
+ size: 80,
+ fill: 0xFFFFFF
+ });
+ numberDisplay.anchor.set(0.5, 0.5);
+ numberDisplay.x = 1024;
+ numberDisplay.y = 1100;
+ numberDisplay.selectorElement = true;
+ game.addChild(numberDisplay);
+ // Cost display
+ var costDisplay = new Text2('Coût: ' + currentNumber * type.cost + ' SM', {
+ size: 40,
+ fill: 0xFFFFFF
+ });
+ costDisplay.anchor.set(0.5, 0.5);
+ costDisplay.x = 1024;
+ costDisplay.y = 1200;
+ costDisplay.selectorElement = true;
+ game.addChild(costDisplay);
+ // Number buttons (1-9, 0)
+ var numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0];
+ var startX = 1024 - 200;
+ var startY = 1300;
+ for (var i = 0; i < numbers.length; i++) {
+ var num = numbers[i];
+ var numberButton = new Container();
+ var numberGraphics = numberButton.attachAsset('numberButton', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ var numText = new Text2(num.toString(), {
+ size: 30,
+ fill: 0xFFFFFF
+ });
+ numText.anchor.set(0.5, 0.5);
+ numberButton.addChild(numText);
+ numberButton.x = startX + i % 5 * 100;
+ numberButton.y = startY + Math.floor(i / 5) * 100;
+ numberButton.selectorElement = true;
+ numberButton.number = num;
+ numberButton.down = function (x, y, obj) {
+ var digit = obj.parent.number;
+ if (currentNumber === 0 || currentNumber.toString().length >= 2) {
+ currentNumber = digit;
+ } else {
+ currentNumber = currentNumber * 10 + digit;
+ }
+ if (currentNumber > maxPuppies) {
+ currentNumber = maxPuppies;
+ }
+ numberDisplay.setText(currentNumber.toString());
+ costDisplay.setText('Coût: ' + currentNumber * type.cost + ' SM');
+ };
+ game.addChild(numberButton);
+ }
+ // Validate button
+ var validateButton = new Container();
+ var validateGraphics = validateButton.attachAsset('typeButton', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ validateGraphics.tint = 0x00ff00;
+ var validateText = new Text2('Valider', {
+ size: 30,
+ fill: 0xFFFFFF
+ });
+ validateText.anchor.set(0.5, 0.5);
+ validateButton.addChild(validateText);
+ validateButton.x = 1024;
+ validateButton.y = 1600;
+ validateButton.selectorElement = true;
+ validateButton.down = function (x, y, obj) {
+ var totalCost = currentNumber * type.cost;
+ if (playerSM >= totalCost && currentNumber > 0) {
+ purchasePuppies(typeKey, currentNumber, totalCost);
+ }
+ closeNumberSelector();
+ };
+ game.addChild(validateButton);
+ // Cancel button
+ var cancelButton = new Container();
+ var cancelGraphics = cancelButton.attachAsset('typeButton', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ cancelGraphics.tint = 0xff0000;
+ var cancelText = new Text2('Annuler', {
+ size: 30,
+ fill: 0xFFFFFF
+ });
+ cancelText.anchor.set(0.5, 0.5);
+ cancelButton.addChild(cancelText);
+ cancelButton.x = 1024;
+ cancelButton.y = 1700;
+ cancelButton.selectorElement = true;
+ cancelButton.down = function (x, y, obj) {
+ closeNumberSelector();
+ };
+ game.addChild(cancelButton);
+}
+function closeShop() {
+ specialPuppyShop.isOpen = false;
+ // Remove all shop elements
+ for (var i = game.children.length - 1; i >= 0; i--) {
+ var child = game.children[i];
+ if (child.shopElement) {
+ child.destroy();
+ }
+ }
+}
+function closeNumberSelector() {
+ // Remove all selector elements
+ for (var i = game.children.length - 1; i >= 0; i--) {
+ var child = game.children[i];
+ if (child.selectorElement) {
+ child.destroy();
+ }
+ }
+}
+function purchasePuppies(typeKey, count, totalCost) {
+ playerSM -= totalCost;
+ storage.playerSM = playerSM;
+ for (var i = 0; i < count; i++) {
+ var puppy;
+ switch (typeKey) {
+ case 'GHOST':
+ puppy = new GhostPuppy();
+ ghostPuppies.push(puppy);
+ break;
+ case 'DRAGON':
+ puppy = new DragonPuppy();
+ dragonPuppies.push(puppy);
+ break;
+ case 'SIREN':
+ puppy = new SirenPuppy();
+ sirenPuppies.push(puppy);
+ break;
+ case 'VAMPIRE':
+ puppy = new VampirePuppy();
+ vampirePuppies.push(puppy);
+ break;
+ case 'LEGENDARY':
+ puppy = new LegendaryPuppy();
+ legendaryPuppies.push(puppy);
+ break;
+ }
+ puppy.x = Math.random() * 1500 + 300;
+ puppy.y = Math.random() * 1000 + 800;
+ puppy.lastX = puppy.x;
+ puppy.lastY = puppy.y;
+ game.addChild(puppy);
+ }
+ updateUI();
+}
function nextLevel() {
currentLevel++;
// Reset to level 1 if we've completed level 200
if (currentLevel > 200) {
@@ -605,9 +1548,32 @@
for (var i = 0; i < puppies.length; i++) {
puppies[i].destroy();
}
puppies = [];
+ // Clear special puppies
+ for (var i = 0; i < ghostPuppies.length; i++) {
+ ghostPuppies[i].destroy();
+ }
+ ghostPuppies = [];
+ for (var i = 0; i < dragonPuppies.length; i++) {
+ dragonPuppies[i].destroy();
+ }
+ dragonPuppies = [];
+ for (var i = 0; i < sirenPuppies.length; i++) {
+ sirenPuppies[i].destroy();
+ }
+ sirenPuppies = [];
+ for (var i = 0; i < vampirePuppies.length; i++) {
+ vampirePuppies[i].destroy();
+ }
+ vampirePuppies = [];
+ for (var i = 0; i < legendaryPuppies.length; i++) {
+ legendaryPuppies[i].destroy();
+ }
+ legendaryPuppies = [];
selectedPuppy = null;
+ // Reset vampire sleep
+ vampireSleepEndTime = 0;
// Reset Mr. Pervers position
mrPervers.x = 1024;
mrPervers.y = 500;
mrPervers.targetPuppy = null;
@@ -658,9 +1624,14 @@
if (lucieDiscountActive && LK.ticks >= lucieDiscountEndTime) {
lucieDiscountActive = false;
updateUI();
}
+ // Handle vampire sleep timer
+ if (LK.ticks >= vampireSleepEndTime && vampireSleepEndTime > 0) {
+ mrPervers.tint = 0xFFFFFF; // Reset tint when waking up
+ }
// Spawn new puppies if screen is empty and we haven't completed the level
- if (puppies.length === 0 && puppiesSaved < puppiesRequired) {
+ var totalPuppies = puppies.length + ghostPuppies.length + dragonPuppies.length + sirenPuppies.length + vampirePuppies.length + legendaryPuppies.length;
+ if (totalPuppies === 0 && puppiesSaved < puppiesRequired) {
spawnPuppies();
}
};
\ No newline at end of file
Fond d'eÌcran restaurant. In-Game asset. 2d. High contrast. No shadows
Porte de sortie. In-Game asset. 2d. High contrast. No shadows
Cuisiniere. In-Game asset. 2d. High contrast. No shadows
Homme bizzare. In-Game asset. 2d. High contrast. No shadows
Chiot (animal). In-Game asset. 2d. High contrast. No shadows
Petite fille de 10 ans. In-Game asset. 2d. High contrast. No shadows
Petit garçon de 12 ans. In-Game asset. 2d. High contrast. No shadows
Chiot fantoÌme (animal). In-Game asset. 2d. High contrast. No shadows
Chiot dragon (animal). In-Game asset. 2d. High contrast. No shadows
Chiot doreÌe (animal). In-Game asset. 2d. High contrast. No shadows
Chiot vampire. In-Game asset. 2d. High contrast. No shadows
Chiot sireÌne. In-Game asset. 2d. High contrast. No shadows
fond mignon kawaii rose. In-Game asset. 2d. High contrast. No shadows