User prompt
Play egg cracking sound when cracking animation run
User prompt
Create a welcome screen and make size choices list game versions 4x4 and 6x6 on the menu
User prompt
Use 5 different image to animate egg cracking sequential ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Make 5 step of egg crack to animate the egg cracking ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Make animation more smooth and slow ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
After egg cracking animation only show the cell images ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
When click the cell make egg cracking animation and the cell image appears after ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Move game title to bottom in the middle
User prompt
Write game title in the middle and show score left upper corner. Locate timer at right upper corner
User prompt
Show the timer on the screen and count down from one minutes. Each matches adds 10 seconds to the game
User prompt
Draw lines between matrix cells
User prompt
Make margins between lmages on matrix
User prompt
Make matrises 6x6
User prompt
If second image matches don't hide both
User prompt
Each second move closes the images if both is not matches
User prompt
Use 8-bit sytle cartoon characters as image and set a 1 min time limiter to game and change game finishes after time exited and the count the matches as score and show the score when the game finished
Code edit (1 edits merged)
Please save this source code
User prompt
Memory Matrix 8-Bit
Initial prompt
Develop an 2d 8bit style image macthing game the hase 5x5 image matris. User Will click each image to revieal and if the second images are matches it Will continue else game finishes
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
/****
* Classes
****/
var Card = Container.expand(function (symbolType) {
var self = Container.call(this);
self.symbolType = symbolType;
self.isRevealed = false;
self.isMatched = false;
// Card background
var cardBack = self.attachAsset('cardBack', {
anchorX: 0.5,
anchorY: 0.5
});
// Card front (hidden initially)
var cardFront = self.attachAsset('cardFront', {
anchorX: 0.5,
anchorY: 0.5,
alpha: 0
});
// Symbol (hidden initially)
var symbol = self.attachAsset('symbol' + symbolType, {
anchorX: 0.5,
anchorY: 0.5,
alpha: 0
});
self.reveal = function () {
if (self.isRevealed || self.isMatched) return;
self.isRevealed = true;
LK.getSound('cardFlip').play();
// Animate card flip
tween(cardBack, {
alpha: 0
}, {
duration: 200
});
tween(cardFront, {
alpha: 1
}, {
duration: 200
});
tween(symbol, {
alpha: 1
}, {
duration: 200
});
};
self.hide = function () {
if (!self.isRevealed || self.isMatched) return;
self.isRevealed = false;
// Animate card flip back
tween(cardBack, {
alpha: 1
}, {
duration: 200
});
tween(cardFront, {
alpha: 0
}, {
duration: 200
});
tween(symbol, {
alpha: 0
}, {
duration: 200
});
};
self.setMatched = function () {
self.isMatched = true;
self.isRevealed = true;
// Flash green to indicate match
tween(cardFront, {
tint: 0x4CAF50
}, {
duration: 300,
onFinish: function onFinish() {
tween(cardFront, {
tint: 0xFFFFFF
}, {
duration: 300
});
}
});
tween(symbol, {
tint: 0x4CAF50
}, {
duration: 300,
onFinish: function onFinish() {
tween(symbol, {
tint: 0xFFFFFF
}, {
duration: 300
});
}
});
};
self.down = function (x, y, obj) {
if (gameState !== 'playing') return;
if (self.isMatched) return;
if (!self.isRevealed) {
if (revealedCards.length < 2) {
self.reveal();
revealedCards.push(self);
if (revealedCards.length === 2) {
checkMatch();
}
}
}
};
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x1A1A1A
});
/****
* Game Code
****/
var gameState = 'playing';
var cards = [];
var revealedCards = [];
var matchedPairs = 0;
var totalPairs = 12;
// Create symbol pairs array
var symbolPairs = [];
for (var i = 1; i <= totalPairs; i++) {
symbolPairs.push(i);
symbolPairs.push(i);
}
// Shuffle the symbol pairs
function shuffleArray(array) {
for (var i = array.length - 1; i > 0; i--) {
var j = Math.floor(Math.random() * (i + 1));
var temp = array[i];
array[i] = array[j];
array[j] = temp;
}
}
shuffleArray(symbolPairs);
// Add one extra card to make 25 total (5x5 grid)
symbolPairs.push(1);
// Create 5x5 grid of cards
var cardSize = 320;
var gridSize = 5;
var startX = (2048 - gridSize * cardSize) / 2 + cardSize / 2;
var startY = (2732 - gridSize * cardSize) / 2 + cardSize / 2;
for (var row = 0; row < gridSize; row++) {
for (var col = 0; col < gridSize; col++) {
var cardIndex = row * gridSize + col;
var card = new Card(symbolPairs[cardIndex]);
card.x = startX + col * cardSize;
card.y = startY + row * cardSize;
cards.push(card);
game.addChild(card);
}
}
// Score display
var scoreTxt = new Text2('Matches: 0', {
size: 80,
fill: 0xFFFFFF
});
scoreTxt.anchor.set(0.5, 0);
LK.gui.top.addChild(scoreTxt);
// Title
var titleTxt = new Text2('Memory Matrix 8-Bit', {
size: 100,
fill: 0xFFD700
});
titleTxt.anchor.set(0.5, 0);
titleTxt.y = 100;
LK.gui.top.addChild(titleTxt);
function checkMatch() {
if (revealedCards.length !== 2) return;
var card1 = revealedCards[0];
var card2 = revealedCards[1];
LK.setTimeout(function () {
if (card1.symbolType === card2.symbolType) {
// Match found
card1.setMatched();
card2.setMatched();
matchedPairs++;
LK.getSound('match').play();
LK.setScore(matchedPairs);
scoreTxt.setText('Matches: ' + matchedPairs);
// Check for victory
if (matchedPairs === totalPairs) {
gameState = 'won';
LK.setTimeout(function () {
LK.showYouWin();
}, 1000);
}
} else {
// No match - game over
gameState = 'gameOver';
LK.getSound('gameOver').play();
// Flash red to indicate wrong match
LK.effects.flashScreen(0xFF0000, 1000);
LK.setTimeout(function () {
LK.showGameOver();
}, 1500);
}
if (gameState === 'playing') {
card1.hide();
card2.hide();
}
revealedCards = [];
}, 1000);
}
game.update = function () {
// Game logic is handled through card interactions
// No continuous updates needed for this game
}; ===================================================================
--- original.js
+++ change.js
@@ -1,6 +1,220 @@
-/****
+/****
+* Plugins
+****/
+var tween = LK.import("@upit/tween.v1");
+
+/****
+* Classes
+****/
+var Card = Container.expand(function (symbolType) {
+ var self = Container.call(this);
+ self.symbolType = symbolType;
+ self.isRevealed = false;
+ self.isMatched = false;
+ // Card background
+ var cardBack = self.attachAsset('cardBack', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ // Card front (hidden initially)
+ var cardFront = self.attachAsset('cardFront', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ alpha: 0
+ });
+ // Symbol (hidden initially)
+ var symbol = self.attachAsset('symbol' + symbolType, {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ alpha: 0
+ });
+ self.reveal = function () {
+ if (self.isRevealed || self.isMatched) return;
+ self.isRevealed = true;
+ LK.getSound('cardFlip').play();
+ // Animate card flip
+ tween(cardBack, {
+ alpha: 0
+ }, {
+ duration: 200
+ });
+ tween(cardFront, {
+ alpha: 1
+ }, {
+ duration: 200
+ });
+ tween(symbol, {
+ alpha: 1
+ }, {
+ duration: 200
+ });
+ };
+ self.hide = function () {
+ if (!self.isRevealed || self.isMatched) return;
+ self.isRevealed = false;
+ // Animate card flip back
+ tween(cardBack, {
+ alpha: 1
+ }, {
+ duration: 200
+ });
+ tween(cardFront, {
+ alpha: 0
+ }, {
+ duration: 200
+ });
+ tween(symbol, {
+ alpha: 0
+ }, {
+ duration: 200
+ });
+ };
+ self.setMatched = function () {
+ self.isMatched = true;
+ self.isRevealed = true;
+ // Flash green to indicate match
+ tween(cardFront, {
+ tint: 0x4CAF50
+ }, {
+ duration: 300,
+ onFinish: function onFinish() {
+ tween(cardFront, {
+ tint: 0xFFFFFF
+ }, {
+ duration: 300
+ });
+ }
+ });
+ tween(symbol, {
+ tint: 0x4CAF50
+ }, {
+ duration: 300,
+ onFinish: function onFinish() {
+ tween(symbol, {
+ tint: 0xFFFFFF
+ }, {
+ duration: 300
+ });
+ }
+ });
+ };
+ self.down = function (x, y, obj) {
+ if (gameState !== 'playing') return;
+ if (self.isMatched) return;
+ if (!self.isRevealed) {
+ if (revealedCards.length < 2) {
+ self.reveal();
+ revealedCards.push(self);
+ if (revealedCards.length === 2) {
+ checkMatch();
+ }
+ }
+ }
+ };
+ return self;
+});
+
+/****
* Initialize Game
-****/
+****/
var game = new LK.Game({
- backgroundColor: 0x000000
-});
\ No newline at end of file
+ backgroundColor: 0x1A1A1A
+});
+
+/****
+* Game Code
+****/
+var gameState = 'playing';
+var cards = [];
+var revealedCards = [];
+var matchedPairs = 0;
+var totalPairs = 12;
+// Create symbol pairs array
+var symbolPairs = [];
+for (var i = 1; i <= totalPairs; i++) {
+ symbolPairs.push(i);
+ symbolPairs.push(i);
+}
+// Shuffle the symbol pairs
+function shuffleArray(array) {
+ for (var i = array.length - 1; i > 0; i--) {
+ var j = Math.floor(Math.random() * (i + 1));
+ var temp = array[i];
+ array[i] = array[j];
+ array[j] = temp;
+ }
+}
+shuffleArray(symbolPairs);
+// Add one extra card to make 25 total (5x5 grid)
+symbolPairs.push(1);
+// Create 5x5 grid of cards
+var cardSize = 320;
+var gridSize = 5;
+var startX = (2048 - gridSize * cardSize) / 2 + cardSize / 2;
+var startY = (2732 - gridSize * cardSize) / 2 + cardSize / 2;
+for (var row = 0; row < gridSize; row++) {
+ for (var col = 0; col < gridSize; col++) {
+ var cardIndex = row * gridSize + col;
+ var card = new Card(symbolPairs[cardIndex]);
+ card.x = startX + col * cardSize;
+ card.y = startY + row * cardSize;
+ cards.push(card);
+ game.addChild(card);
+ }
+}
+// Score display
+var scoreTxt = new Text2('Matches: 0', {
+ size: 80,
+ fill: 0xFFFFFF
+});
+scoreTxt.anchor.set(0.5, 0);
+LK.gui.top.addChild(scoreTxt);
+// Title
+var titleTxt = new Text2('Memory Matrix 8-Bit', {
+ size: 100,
+ fill: 0xFFD700
+});
+titleTxt.anchor.set(0.5, 0);
+titleTxt.y = 100;
+LK.gui.top.addChild(titleTxt);
+function checkMatch() {
+ if (revealedCards.length !== 2) return;
+ var card1 = revealedCards[0];
+ var card2 = revealedCards[1];
+ LK.setTimeout(function () {
+ if (card1.symbolType === card2.symbolType) {
+ // Match found
+ card1.setMatched();
+ card2.setMatched();
+ matchedPairs++;
+ LK.getSound('match').play();
+ LK.setScore(matchedPairs);
+ scoreTxt.setText('Matches: ' + matchedPairs);
+ // Check for victory
+ if (matchedPairs === totalPairs) {
+ gameState = 'won';
+ LK.setTimeout(function () {
+ LK.showYouWin();
+ }, 1000);
+ }
+ } else {
+ // No match - game over
+ gameState = 'gameOver';
+ LK.getSound('gameOver').play();
+ // Flash red to indicate wrong match
+ LK.effects.flashScreen(0xFF0000, 1000);
+ LK.setTimeout(function () {
+ LK.showGameOver();
+ }, 1500);
+ }
+ if (gameState === 'playing') {
+ card1.hide();
+ card2.hide();
+ }
+ revealedCards = [];
+ }, 1000);
+}
+game.update = function () {
+ // Game logic is handled through card interactions
+ // No continuous updates needed for this game
+};
\ No newline at end of file
Make it 8 bit style dinosaur cartoon character. In-Game asset. High contrast. No shadows
8 bit style dinosaur egg. 2d. High contrast. No shadows. 8 bit
Generate cracked version
Make it different color
Make it blue
Make it 8 bit style dinosaur Achelousaurus cartoon character. In-Game asset. High contrast. No shadows
Make it 8 bit style dinosaur Ankylosaurus cartoon character. In-Game asset. High contrast. No shadows
Make it 8 bit style dinosaur Atrociraptor cartoon character. In-Game asset. High contrast. No shadows
Make it 8 bit style dinosaur Anchiornis cartoon character. In-Game asset. High contrast. No shadows
Make it 8 bit style dinosaur pterodactyl cartoon character. In-Game asset. High contrast. No shadows
Make it 8 bit style dinosaur stegosaurus cartoon character. In-Game asset. High contrast. No shadows
Make it 8 bit style dinosaur parasaurus cartoon character. In-Game asset. High contrast. No shadows