/**** * Classes ****/ // Enemy Beyblade class var EnemyBeyblade = Container.expand(function () { var self = Container.call(this); var beybladeGraphics = self.attachAsset('enemyBeyblade', { anchorX: 0.5, anchorY: 0.5 }); self.rotationSpeed = 0.1; self.update = function () { beybladeGraphics.rotation += self.rotationSpeed; }; }); //<Assets used in the game will automatically appear here> //<Write imports for supported plugins here> // Player Beyblade class var PlayerBeyblade = Container.expand(function () { var self = Container.call(this); var beybladeGraphics = self.attachAsset('playerBeyblade', { anchorX: 0.5, anchorY: 0.5 }); self.rotationSpeed = 0.1; self.update = function () { beybladeGraphics.rotation += self.rotationSpeed; }; self.down = function (x, y, obj) { self.x = x; self.y = y; }; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x000000 //Init game with black background }); /**** * Game Code ****/ // Initialize player and enemy beyblades var playerBeyblade = new PlayerBeyblade(); playerBeyblade.x = 1024; // Center horizontally playerBeyblade.y = 2000; // Position near the bottom game.addChild(playerBeyblade); var enemyBeyblade = new EnemyBeyblade(); enemyBeyblade.x = 1024; // Center horizontally enemyBeyblade.y = 732; // Position near the top game.addChild(enemyBeyblade); // Game update loop game.update = function () { playerBeyblade.update(); enemyBeyblade.update(); // Check for collision if (playerBeyblade.intersects(enemyBeyblade)) { // Handle collision LK.effects.flashScreen(0xff0000, 500); LK.showGameOver(); } }; // Handle player beyblade movement game.down = function (x, y, obj) { playerBeyblade.down(x, y, obj); };
/****
* Classes
****/
// Enemy Beyblade class
var EnemyBeyblade = Container.expand(function () {
var self = Container.call(this);
var beybladeGraphics = self.attachAsset('enemyBeyblade', {
anchorX: 0.5,
anchorY: 0.5
});
self.rotationSpeed = 0.1;
self.update = function () {
beybladeGraphics.rotation += self.rotationSpeed;
};
});
//<Assets used in the game will automatically appear here>
//<Write imports for supported plugins here>
// Player Beyblade class
var PlayerBeyblade = Container.expand(function () {
var self = Container.call(this);
var beybladeGraphics = self.attachAsset('playerBeyblade', {
anchorX: 0.5,
anchorY: 0.5
});
self.rotationSpeed = 0.1;
self.update = function () {
beybladeGraphics.rotation += self.rotationSpeed;
};
self.down = function (x, y, obj) {
self.x = x;
self.y = y;
};
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x000000 //Init game with black background
});
/****
* Game Code
****/
// Initialize player and enemy beyblades
var playerBeyblade = new PlayerBeyblade();
playerBeyblade.x = 1024; // Center horizontally
playerBeyblade.y = 2000; // Position near the bottom
game.addChild(playerBeyblade);
var enemyBeyblade = new EnemyBeyblade();
enemyBeyblade.x = 1024; // Center horizontally
enemyBeyblade.y = 732; // Position near the top
game.addChild(enemyBeyblade);
// Game update loop
game.update = function () {
playerBeyblade.update();
enemyBeyblade.update();
// Check for collision
if (playerBeyblade.intersects(enemyBeyblade)) {
// Handle collision
LK.effects.flashScreen(0xff0000, 500);
LK.showGameOver();
}
};
// Handle player beyblade movement
game.down = function (x, y, obj) {
playerBeyblade.down(x, y, obj);
};
Photorealistic Concrete pavement, top view
Simple black circle with transparent background
Simple one black lined circle with transparent background
PHOTOREALISTIC Simple black circular arena with honeycomb pattern. In the center is a neon green circle with a circle colored red along the edge. TOP VIEW.
Blue beyblade, TOP VIEW
Photorealistic Red beyblade, top view
fire sparks
fire spark