Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught TypeError: cardGraphics.setTexture is not a function' in or related to this line: 'cardGraphics.setTexture(LK.getAsset(self.type, {' Line Number: 30
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Script error.' in or related to this line: 'cardGraphics.setTexture(LK.getAsset(self.type, {}));' Line Number: 30
User prompt
The function handlecardselection is also useless. I never wanted something like this. I told you, the user can flip one card at one time. Do no match yet. I want to explain it step by step. Don‘t do bullshit like this.
User prompt
Make the uselese checkMatch function empty
Code edit (1 edits merged)
Please save this source code
User prompt
Make every play function empty. This really sucks. I just want the 4x4 card field with the cards with hidden values.
User prompt
I want to restart the code. Male it empty except the 4x4 card field.
User prompt
Please fix the bug: 'undefined is not an object (evaluating 'self.down = function (x, y, obj) { __$(42); if (!this.isFlipped) { __$(43); this.flip(); __$(44); LK.getSound('TurnCard').play(); } }')' in or related to this line: 'self.down = function (x, y, obj) {' Line Number: 98
User prompt
Please fix the bug: 'undefined is not an object (evaluating 'self.down = function (x, y, obj) { __$(42); if (!self.isFlipped) { __$(43); self.flip(); __$(44); LK.getSound('TurnCard').play(); } }')' in or related to this line: 'self.down = function (x, y, obj) {' Line Number: 98
User prompt
Please fix the bug: 'undefined is not an object (evaluating 'self.down = function (x, y, obj) { __$(42); if (!this.isFlipped) { __$(43); this.flip(); __$(44); LK.getSound('TurnCard').play(); } }')' in or related to this line: 'self.down = function (x, y, obj) {' Line Number: 98
User prompt
Please fix the bug: 'undefined is not an object (evaluating 'self.down = function (x, y, obj) { __$(42); if (!self.isFlipped) { __$(43); self.flip(); __$(44); LK.getSound('TurnCard').play(); } }')' in or related to this line: 'self.down = function (x, y, obj) {' Line Number: 98
User prompt
Please fix the bug: 'undefined is not an object (evaluating 'self.down = function (x, y, obj) { __$(42); if (!this.isFlipped) { __$(43); this.flip(); __$(44); LK.getSound('TurnCard').play(); } }')' in or related to this line: 'self.down = function (x, y, obj) {' Line Number: 98
User prompt
Please fix the bug: 'undefined is not an object (evaluating 'self.down = function (x, y, obj) { __$(42); if (!self.isFlipped) { __$(43); self.flip(); __$(44); LK.getSound('TurnCard').play(); } }')' in or related to this line: 'self.down = function (x, y, obj) {' Line Number: 98
User prompt
Please fix the bug: 'undefined is not an object (evaluating 'self.down = function (x, y, obj) { __$(42); if (!this.isFlipped) { __$(43); this.flip(); __$(44); LK.getSound('TurnCard').play(); } }')' in or related to this line: 'self.down = function (x, y, obj) {' Line Number: 98
User prompt
Please fix the bug: 'undefined is not an object (evaluating 'self.down = function (x, y, obj) { __$(42); if (!self.isFlipped) { __$(43); self.flip(); __$(44); LK.getSound('TurnCard').play(); } }')' in or related to this line: 'self.down = function (x, y, obj) {' Line Number: 98
User prompt
Please fix the bug: 'undefined is not an object (evaluating 'self.down = function (x, y, obj) { __$(42); if (!this.isFlipped) { __$(43); this.flip(); __$(44); LK.getSound('TurnCard').play(); } }')' in or related to this line: 'self.down = function (x, y, obj) {' Line Number: 98
User prompt
Please fix the bug: 'undefined is not an object (evaluating 'self.down = function (x, y, obj) { __$(42); if (!this.isFlipped) { __$(43); this.flip(); __$(44); LK.getSound('TurnCard').play(); } }')' in or related to this line: 'self.down = function (x, y, obj) {' Line Number: 98
User prompt
Please fix the bug: 'undefined is not an object (evaluating 'self.down = function (x, y, obj) { __$(42); if (!this.isFlipped) { __$(43); this.flip(); __$(44); LK.getSound('TurnCard').play(); } }')' in or related to this line: 'self.down = function (x, y, obj) {' Line Number: 98
User prompt
Please fix the bug: 'undefined is not an object (evaluating 'self.down = function (x, y, obj) { __$(42); if (!self.isFlipped) { __$(43); self.flip(); __$(44); LK.getSound('TurnCard').play(); } }')' in or related to this line: 'self.down = function (x, y, obj) {' Line Number: 98
User prompt
Please fix the bug: 'undefined is not an object (evaluating 'self.down = function (x, y, obj) { __$(42); if (!this.isFlipped) { __$(43); this.flip(); __$(44); LK.getSound('TurnCard').play(); } }')' in or related to this line: 'self.down = function (x, y, obj) {' Line Number: 98
User prompt
Please fix the bug: 'undefined is not an object (evaluating 'self.down = function (x, y, obj) { __$(42); if (!self.isFlipped) { __$(43); self.flip(); __$(44); LK.getSound('TurnCard').play(); } }')' in or related to this line: 'self.down = function (x, y, obj) {' Line Number: 98
User prompt
Please fix the bug: 'undefined is not an object (evaluating 'self.down = function (x, y, obj) { __$(42); if (!this.isFlipped) { __$(43); this.flip(); __$(44); LK.getSound('TurnCard').play(); } }')' in or related to this line: 'self.down = function (x, y, obj) {' Line Number: 98
User prompt
Please fix the bug: 'undefined is not an object (evaluating 'self.down = function (x, y, obj) { __$(42); if (!this.isFlipped) { __$(43); this.flip(); __$(44); LK.getSound('TurnCard').play(); } }')' in or related to this line: 'self.down = function (x, y, obj) {' Line Number: 98
/****
* Classes
****/
//<Assets used in the game will automatically appear here>
//<Write imports for supported plugins here>
// Class for Card
var Card = Container.expand(function () {
var self = Container.call(this);
var cardGraphics = self.attachAsset('card', {
anchorX: 0.5,
anchorY: 0.5
});
self.type = null;
self.isFlipped = false;
self.flip = function () {
self.isFlipped = !self.isFlipped;
if (self.isFlipped) {
cardGraphics.setTexture(LK.getAsset(self.type, {
anchorX: 0.5,
anchorY: 0.5
}));
} else {
cardGraphics.setTexture(LK.getAsset('card', {
anchorX: 0.5,
anchorY: 0.5
}));
}
};
self.setType = function (type) {
self.type = type;
};
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x000000 //Init game with black background
});
/****
* Game Code
****/
// Initialize variables
var cards = [];
var selectedCards = [];
var cardTypes = ['dog', 'cat', 'rat', 'mysticHand', 'bird', 'elephant', 'boar', 'magnifier'];
var score = 0;
// Create and position cards
function createCards() {
var cardTypes = ['dog', 'cat', 'rat', 'mysticHand', 'bird', 'elephant', 'boar', 'magnifier'];
cardTypes = cardTypes.concat(cardTypes); // duplicate the array
cardTypes.sort(function () {
return Math.random() - 0.5;
}); // shuffle the array
for (var i = 0; i < 16; i++) {
var card = new Card();
card.x = (game.width - 4 * 320) / 2 + i % 4 * 240; // Center the cards horizontally with increased margin
card.y = game.height - 4 * 340 + Math.floor(i / 4) * 340 + 100; // Position the cards at the bottom center with increased margin
card.setType(cardTypes[i]);
cards.push(card);
game.addChild(card);
}
}
// Check if selected cards match
function checkMatch() {}
// Initialize game
createCards();
// Add event listeners
game.down = function (x, y, obj) {
var localPos = game.toLocal(obj.global);
cards.forEach(function (card) {
if (card.getBounds().contains(localPos.x, localPos.y)) {
card.flip();
// Play turn card sound
LK.getSound('TurnCard').play();
}
});
};
// Update game state
game.update = function () {};
// Play main theme
LK.playMusic('MainTheme', {
loop: true
}); ===================================================================
--- original.js
+++ change.js
@@ -43,9 +43,9 @@
****/
// Initialize variables
var cards = [];
var selectedCards = [];
-var cardTypes = ['rock', 'paper', 'scissors'];
+var cardTypes = ['dog', 'cat', 'rat', 'mysticHand', 'bird', 'elephant', 'boar', 'magnifier'];
var score = 0;
// Create and position cards
function createCards() {
var cardTypes = ['dog', 'cat', 'rat', 'mysticHand', 'bird', 'elephant', 'boar', 'magnifier'];
@@ -54,10 +54,10 @@
return Math.random() - 0.5;
}); // shuffle the array
for (var i = 0; i < 16; i++) {
var card = new Card();
- card.x = (game.width - 4 * 240) / 2 + i % 4 * 240; // Center the cards horizontally with increased margin
- card.y = game.height - 4 * 340 + Math.floor(i / 4) * 340 + 200; // Position the cards at the bottom center with increased margin
+ card.x = (game.width - 4 * 320) / 2 + i % 4 * 240; // Center the cards horizontally with increased margin
+ card.y = game.height - 4 * 340 + Math.floor(i / 4) * 340 + 100; // Position the cards at the bottom center with increased margin
card.setType(cardTypes[i]);
cards.push(card);
game.addChild(card);
}
Cardback with the Symbol ♾️ on it. Single Game Texture. In-Game asset. 2d. High contrast. No shadows.
A cardback in brown empy color with mystical corners. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A good but dangerous elephant. Warcraft 3 art. Single Game Texture. In-Game asset. 2d. High contrast. No shadows.
A good but dangerous falcon. Warcraft 3 art. Single Game Texture. In-Game asset. 2d. High contrast. No shadows.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A good but dangerous boar. Warcraft 3 art. Single Game Texture. In-Game asset. 2d. High contrast. No shadows.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A good but dangerous cat. Warcraft 3 art.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A good but dangerous magnifier. Warcraft 3 art.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A mystical spirit hand. Warcraft 3 art.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A good but dangerous rat. Warcraft 3 art.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A wooden play board with leaves. Fantasy. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A mystical rectangle fantasy board with leaves.
Warcraft 3 art of a boot. Side-view.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Warcraft 3 art of a hammer.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Warcraft 3 image of a bow.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Warcraft 3 image of an arrow.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Warcraft 3 image of a medieval arrow.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Warcraft 3 art of a shield.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
warcraft 3 art of a fist.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.