/**** * Classes ****/ //<Assets used in the game will automatically appear here> //<Write imports for supported plugins here> // Player Beyblade class var Arena = Container.expand(function () { var self = Container.call(this); var arenaGraphics = self.attachAsset('arena', { anchorX: 0.5, anchorY: 0.5 }); }); // 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; }; }); 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 arena = new Arena(); arena.x = 1024; // Center horizontally arena.y = 1366; // Center vertically game.addChild(arena); 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); };
===================================================================
--- original.js
+++ change.js
@@ -1,49 +1,60 @@
-/****
+/****
* 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 Arena = Container.expand(function () {
+ var self = Container.call(this);
+ var arenaGraphics = self.attachAsset('arena', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+});
+// 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;
+ };
+});
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;
- };
+ 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
+ backgroundColor: 0x000000 //Init game with black background
});
-/****
+/****
* Game Code
-****/
+****/
// Initialize player and enemy beyblades
+var arena = new Arena();
+arena.x = 1024; // Center horizontally
+arena.y = 1366; // Center vertically
+game.addChild(arena);
var playerBeyblade = new PlayerBeyblade();
playerBeyblade.x = 1024; // Center horizontally
playerBeyblade.y = 2000; // Position near the bottom
game.addChild(playerBeyblade);
@@ -52,17 +63,17 @@
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();
- }
+ 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);
+ playerBeyblade.down(x, y, obj);
};
\ No newline at end of file
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