/****
* 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 originalAsset = self.attachAsset('card', {
anchorX: 0.5,
anchorY: 0.5
});
var cardGraphics = originalAsset; // Referenz für das aktuelle Asset
self.type = null;
self.isFlipped = false;
self.flip = function () {
if (!self.isFlipped) {
// Alle anderen Karten zurückflippen
cards.forEach(function (c) {
if (c.isFlipped) {
c.isFlipped = false;
c.cardGraphics = c.attachAsset('card', {
anchorX: 0.5,
anchorY: 0.5
});
}
});
// Diese Karte flippen
LK.getSound('TurnCard').play();
self.isFlipped = true;
cardGraphics = self.attachAsset('flippedCard', {
anchorX: 0.5,
anchorY: 0.5
});
// Add a sprite to the card when it is flipped
var sprite = self.attachAsset('jar' + self.type + 'Image', {
anchorX: 0.5,
anchorY: 0.5
});
}
};
self.on('down', function (x, y, obj) {
if (!self.isFlipped) {
self.flip();
}
});
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 cardTypes = ['Boot', 'Jump', 'Shield', 'Fist', 'Bow', 'Arrow', 'Hammer', 'Trap'];
var score = 0;
var cardInformation = [{
name: 'dog',
beats: ['cat', 'bird'],
speed: 2,
canJump: true,
canClimb: false,
canSwim: true,
canFly: false,
canBreak: false
}, {
name: 'cat',
beats: ['rat', 'bird'],
speed: 2,
canJump: true,
canClimb: true,
canSwim: false,
canFly: false,
canBreak: false
}, {
name: 'rat',
beats: ['elephant'],
speed: 2,
canJump: true,
canClimb: true,
canSwim: true,
canFly: false,
canBreak: false
}, {
name: 'bird',
beats: ['rat'],
speed: 2,
canJump: false,
canClimb: false,
canSwim: true,
canFly: true,
canBreak: false
}, {
name: 'boar',
beats: ['rat', 'cat', 'dog'],
speed: 2,
canJump: false,
canClimb: false,
canSwim: true,
canFly: false,
canBreak: true
}, {
name: 'elephant',
beats: ['cat', 'dog', 'boar'],
speed: 2,
canJump: false,
canClimb: false,
canSwim: true,
canFly: false,
canBreak: true
}];
// Create and position cards
function createCards() {
var cardTypes = ['Boot', 'Boot', 'Boot', 'Jump', 'Jump', 'Shield', 'Shield', 'Fist', 'Bow', 'Arrow', 'Hammer', 'Trap'];
//var cardTypes = ['boot', '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 - 2 * 500) / 2 + i % 4 * 360; // Center the cards horizontally with increased margin
card.y = game.height - 4 * 400 + Math.floor(i / 4) * 420 + 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() {}
// Attach the background images to the game
var topBackground = game.attachAsset('topBackground', {
anchorX: 0.5,
anchorY: 0.0,
x: game.width / 2,
y: -500
});
var bottomBackground = game.attachAsset('bottomBackground', {
anchorX: 0.5,
anchorY: 1.0,
x: game.width / 2,
y: game.height + 100
});
// Initialize game
createCards();
// Update game state
game.update = function () {};
// Play main theme
theme = 'MainTheme';
LK.playMusic(theme, {
loop: true
}); /****
* 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 originalAsset = self.attachAsset('card', {
anchorX: 0.5,
anchorY: 0.5
});
var cardGraphics = originalAsset; // Referenz für das aktuelle Asset
self.type = null;
self.isFlipped = false;
self.flip = function () {
if (!self.isFlipped) {
// Alle anderen Karten zurückflippen
cards.forEach(function (c) {
if (c.isFlipped) {
c.isFlipped = false;
c.cardGraphics = c.attachAsset('card', {
anchorX: 0.5,
anchorY: 0.5
});
}
});
// Diese Karte flippen
LK.getSound('TurnCard').play();
self.isFlipped = true;
cardGraphics = self.attachAsset('flippedCard', {
anchorX: 0.5,
anchorY: 0.5
});
// Add a sprite to the card when it is flipped
var sprite = self.attachAsset('jar' + self.type + 'Image', {
anchorX: 0.5,
anchorY: 0.5
});
}
};
self.on('down', function (x, y, obj) {
if (!self.isFlipped) {
self.flip();
}
});
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 cardTypes = ['Boot', 'Jump', 'Shield', 'Fist', 'Bow', 'Arrow', 'Hammer', 'Trap'];
var score = 0;
var cardInformation = [{
name: 'dog',
beats: ['cat', 'bird'],
speed: 2,
canJump: true,
canClimb: false,
canSwim: true,
canFly: false,
canBreak: false
}, {
name: 'cat',
beats: ['rat', 'bird'],
speed: 2,
canJump: true,
canClimb: true,
canSwim: false,
canFly: false,
canBreak: false
}, {
name: 'rat',
beats: ['elephant'],
speed: 2,
canJump: true,
canClimb: true,
canSwim: true,
canFly: false,
canBreak: false
}, {
name: 'bird',
beats: ['rat'],
speed: 2,
canJump: false,
canClimb: false,
canSwim: true,
canFly: true,
canBreak: false
}, {
name: 'boar',
beats: ['rat', 'cat', 'dog'],
speed: 2,
canJump: false,
canClimb: false,
canSwim: true,
canFly: false,
canBreak: true
}, {
name: 'elephant',
beats: ['cat', 'dog', 'boar'],
speed: 2,
canJump: false,
canClimb: false,
canSwim: true,
canFly: false,
canBreak: true
}];
// Create and position cards
function createCards() {
var cardTypes = ['Boot', 'Boot', 'Boot', 'Jump', 'Jump', 'Shield', 'Shield', 'Fist', 'Bow', 'Arrow', 'Hammer', 'Trap'];
//var cardTypes = ['boot', '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 - 2 * 500) / 2 + i % 4 * 360; // Center the cards horizontally with increased margin
card.y = game.height - 4 * 400 + Math.floor(i / 4) * 420 + 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() {}
// Attach the background images to the game
var topBackground = game.attachAsset('topBackground', {
anchorX: 0.5,
anchorY: 0.0,
x: game.width / 2,
y: -500
});
var bottomBackground = game.attachAsset('bottomBackground', {
anchorX: 0.5,
anchorY: 1.0,
x: game.width / 2,
y: game.height + 100
});
// Initialize game
createCards();
// Update game state
game.update = function () {};
// Play main theme
theme = 'MainTheme';
LK.playMusic(theme, {
loop: true
});
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.