User prompt
don't double the object with level do only little bit speed If player get 5000 point move to level 2
User prompt
Make more levels
User prompt
Make point by objects 0-20 point max by spheres size
User prompt
No count for the objects
User prompt
Set scoreStart level 1 only no other levels
User prompt
Don't count spheres from the respawn point Don't move to level 2 till only if player get 500 point
User prompt
1-make score 0 2-count only if sphere pass the dragon to the top screen without touching it 3-make random point by each size of spheres
User prompt
Count only if the dragon dodge the spheres make random points from 0-50 max from each sphere by its size.
User prompt
resize it with same size of level text
User prompt
Move it to the left side
User prompt
creat a text for the score on the level
User prompt
make the score text position above the level text
User prompt
1-Make a score text above the level with the same size 2-color green
User prompt
resize score text to 800
User prompt
resize score text 300
User prompt
1-Make points for each spheres by its size 2-limit amount of points is 50
User prompt
Please fix the bug: 'ReferenceError: size is not defined' in or related to this line: 'self.points = Math.floor(size * 50); // Points based on size of the sphere' Line Number: 53
User prompt
1-make level by points only 2-make points from spheres by size of it from 0 to 50 randomly 3-make level like this if player get 500 point go to level 2 so on...
User prompt
Stop level counting only if player get 500 point go to next level, random points from dodging spheres
User prompt
Move it to the down right side of the screen
User prompt
resize it to 100
User prompt
Make level text inside the screen on the left side
User prompt
Make the text inside the out liner of the screen , no object outside the outlines
User prompt
move it to the left side
User prompt
resize it to 300
/**** * Classes ****/ //<Assets used in the game will automatically appear here> //<Write imports for supported plugins here> // Dragon class to represent the player character var Dragon = Container.expand(function () { var self = Container.call(this); var dragonGraphics = self.attachAsset('dragon', { anchorX: 0.5, anchorY: 0.5, scaleX: 1.5, scaleY: 1.5 }); self.speed = 10; // Speed of the dragon self.update = function () { // Update logic for the dragon can be added here if needed }; }); // HealthBar class to represent the player's health var HealthBar = Container.expand(function () { var self = Container.call(this); var healthBarGraphics = self.attachAsset('healthBar', { anchorX: 0.0, anchorY: 0.0, scaleX: 2048 / 1000, // Scale to fit the game width scaleY: 0.1 }); self.maxHealth = 1000; self.currentHealth = self.maxHealth; self.update = function () { healthBarGraphics.scaleX = self.currentHealth / self.maxHealth; healthBarGraphics.scaleY = 0.05; // Resize the health bar to fit the top of the screen }; }); // Sphere class to represent the obstacles var Sphere = Container.expand(function () { var self = Container.call(this); var sphereGraphics = self.attachAsset('sphere', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 5; // Speed of the sphere var sizes = [0.7, 0.5, 1]; var size = sizes[Math.floor(Math.random() * sizes.length)]; self.points = Math.floor(Math.random() * 21); // Assign random points to each sphere based on its size self.update = function () { self.y -= self.speed; // Move the sphere upwards }; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x000000, //Init game with black background height: 3000 // Increase the game screen height }); /**** * Game Code ****/ // Initialize game variables var dragon; var spheres = []; var score = 0; // Initialize score to 0 var scoreTxt; // Add background image to the game var background = LK.getAsset('Background', { anchorX: 0.0, anchorY: 0.0 }); background = game.addChild(background); background.width = game.width; background.height = game.height; background.smooth = true; // Enable smoothing to make the screen appear clearer background.scale.set(game.width / background.width, game.height / background.height); // Scale the background to fit the screen // Function to handle game updates game.update = function () { // Update dragon position based on touch input if (dragNode && dragNode.global) { dragNode.x = game.toLocal(dragNode.global).x; } // Update spheres and check for collisions for (var i = spheres.length - 1; i >= 0; i--) { spheres[i].update(); if (spheres[i].intersects(dragon)) { var evade = Math.floor(Math.random() * 51); if (evade <= 50) { healthBar.currentHealth -= spheres[i].points / 4; // Reduce health based on points if (healthBar.currentHealth <= 0) { LK.effects.flashScreen(0xff0000, 1000); LK.showGameOver({ bar: { color: 0xFFA500, // Orange color for the outlines fill: 0xFFA500 // Orange color for the fill }, text: { color: 0x00FFFF // Blue cyan color for the text } }); } } else { score += spheres[i].points; // Increase score based on the size of the sphere scoreTxt.setText('Score: ' + score); // Update score text } } else if (spheres[i].y < 0 && spheres[i].y > -50) { score += spheres[i].points; // Increase score when sphere passes the dragon without touching it scoreTxt.setText('Score: ' + score); // Update score text } if (spheres[i].y < -50) { spheres[i].destroy(); spheres.splice(i, 1); } } // Spawn new spheres if (LK.ticks % 30 == 0) { var level = Math.floor(score / 5000) + 1; // Calculate the current level based on the score for (var i = 0; i < level; i++) { // Spawn more spheres based on the current level var newSphere = new Sphere(); newSphere.x = Math.random() * 2048; newSphere.y = 2732; // Randomly assign one of three sizes to the sphere var sizes = [0.7, 0.5, 1]; var size = sizes[Math.floor(Math.random() * sizes.length)]; newSphere.scaleX = size; newSphere.scaleY = size; newSphere.speed += level * 0.1; // Increase the speed of the sphere slightly with each level spheres.push(newSphere); game.addChild(newSphere); } levelTxt.setText('Level: ' + level); // Update the level text } }; // Initialize dragon dragon = game.addChild(new Dragon()); dragon.x = 2048 / 2; dragon.y = 200; // Initialize level display var levelTxt = new Text2('Level: 1', { size: 100, fill: 0xFFFF00 }); levelTxt.anchor.set(1, 1); LK.gui.bottomRight.addChild(levelTxt); levelTxt.x = -50; // Move the level text to the right side of the screen levelTxt.y = -50; // Position the level text at the bottom of the screen // Initialize score display scoreTxt = new Text2('Score: 0', { size: 100, fill: 0x008000 // Green color }); LK.gui.top.addChild(scoreTxt); scoreTxt.anchor.set(0, 0); // Sets anchor to the left of the top edge of the text. scoreTxt.x = 0; // Position the score text on the left side of the screen scoreTxt.y = levelTxt.y - scoreTxt.height - 50; // Position the score text 50 pixels above the level text // Initialize health bar var healthBar = game.addChild(new HealthBar()); healthBar.x = 50; healthBar.y = 2732 - healthBar.height - 50; scoreTxt.anchor.set(0, 0); LK.gui.bottomLeft.addChild(scoreTxt); // Handle touch input for dragging the dragon var dragNode = null; game.down = function (x, y, obj) { dragNode = dragon; }; game.up = function (x, y, obj) { dragNode = null; }; game.move = function (x, y, obj) { if (dragNode) { // Limit the dragon's movement to the game area var newX = Math.max(0, Math.min(2048, x)); dragNode.x = newX; } };
===================================================================
--- original.js
+++ change.js
@@ -117,9 +117,9 @@
}
}
// Spawn new spheres
if (LK.ticks % 30 == 0) {
- var level = Math.floor(score / 500) + 1; // Calculate the current level based on the score
+ var level = Math.floor(score / 5000) + 1; // Calculate the current level based on the score
for (var i = 0; i < level; i++) {
// Spawn more spheres based on the current level
var newSphere = new Sphere();
newSphere.x = Math.random() * 2048;
@@ -128,8 +128,9 @@
var sizes = [0.7, 0.5, 1];
var size = sizes[Math.floor(Math.random() * sizes.length)];
newSphere.scaleX = size;
newSphere.scaleY = size;
+ newSphere.speed += level * 0.1; // Increase the speed of the sphere slightly with each level
spheres.push(newSphere);
game.addChild(newSphere);
}
levelTxt.setText('Level: ' + level); // Update the level text
floating land world imagination green colors not pixels no text in the image. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Pack of different standing white dragon of stone on four legs, looking down. HD different mixed colors. Blur. not a sculpt model! the dragon is a real dragon have all things of dragon with opened mouth like he ready to shoot, have eyes opened . Single Game Texture. In-Game asset. 2D. Blank background. High contrast. No shadows.
Different standing dragon on four legs, looking down. have mixed colors. Blur. the dragon is opened mouth like he is ready to shout. Single Game Texture. In-Game asset. 3D. Blank background. High contrast. No shadows.
Different standing dragon of forest on four legs, he's head is down and opened mouth to shout. HD colors. Single Game Texture. In-Game asset. 3D. Blank background. High contrast. No shadows.
Airball of dragon shout. sphere. HD colors.. In-Game asset. 2d. High contrast. No shadows
Airball explosion. sphere. mixed grey with white & blue colors. HD colors In-Game asset. 2d. High contrast. No shadows
Air airball shout of a dragon. sphere. mixed grey with white & blue colors. HD colors In-Game asset. 2d. High contrast. No shadows
Different standing dragons on four legs, looking down. HD colors. the dragon is opened mouth like he is ready to shout. Single Game Texture. In-Game asset. 3D. Blank background. High contrast. No shadows.
standing air dragons on four legs, looking down. HD blue color. the dragon is opened mouth like he is ready to shout. Single Game Texture. In-Game asset. 3D. Blank background. High contrast. No shadows.
Medieval "start game" buttons. HD colors. In-Game asset. High contrast. No shadows. 3D
Medieval 'High score' buttons. HD colors. In-Game asset. High contrast. No shadows. 3D
Airball of dragon shout. sphere. HD colors.. In-Game asset. 2d. High contrast. No shadows