User prompt
The laser should never block the ball in order!
User prompt
Rename jediTrainingBall to JediTrainingBall
User prompt
Add to the game a Lightsaber song
User prompt
The laser should never block the ball in order!
User prompt
rename sword to laser
User prompt
Please fix the bug: 'ReferenceError: laser is not defined' in or related to this line: 'laser.x = 2048 / 2;' Line Number: 88
User prompt
delete laser asset from the game
User prompt
rename sword to laser
User prompt
The ball should be able to eject laser beams that line up from the bottom of the ball towards the center of the bottom of the screen.
User prompt
The ball should be able to shoot laser beams out of itself in the direction of the bottom of the screen.
User prompt
Please fix the bug: 'ReferenceError: paddles is not defined' in or related to this line: 'for (var i = 0; i < paddles.length; i++) {' Line Number: 108
User prompt
The paddle asset is located in the lower part of the track!
User prompt
Please fix the bug: 'ReferenceError: aiPaddle is not defined' in or related to this line: 'aiPaddle.x = 2048 / 2;' Line Number: 89
User prompt
There can only be one piece of the paddle asset on this map, in the lower part of the map, which the player can control by moving the mouse.
User prompt
Add to the game a paddle asset
User prompt
The ball can move anywhere within the previously specified values and may change direction suddenly.
User prompt
If the ball touches the distance of 100 units from the left or right edges of the screen, it bounces.
User prompt
If the ball touches the distance of 77 units from the left or right edges of the screen, it bounces.
User prompt
If the ball touches the distance of 50 units from the left or right edges of the screen, it bounces.
User prompt
If the ball touches the distance of 25 units from the left or right edges of the screen, it bounces.
User prompt
The ball bounces from a distance of 25 units from the edges of the screen.
User prompt
The ball bounces off the edges of the screen
User prompt
The ball bounces from a distance of 25 units from the edges of the screen
User prompt
Once loaded, this ball will never touch the edges of the screen!
User prompt
In the game, this map begins with this Jedi training ball asset loading from the top of the screen, centered, and stops at a distance of 500 units from the center
/**** * Classes ****/ var JediTrainingBall = Container.expand(function () { var self = Container.call(this); var ballGraphics = self.attachAsset('jediTrainingBall', { anchorX: 0.5, anchorY: 0.5 }); self.speed = { x: 5, y: 5 }; self._move_migrated = function () { self.x += self.speed.x; self.y += self.speed.y; if (self.y >= 2732 / 2 - 500) { self.speed.y = 0; } if (self.x <= 100 || self.x >= 2048 - 100) { self.speed.x *= -1; } if (self.y <= 0 || self.y >= 2732) { self.speed.y *= -1; } }; }); var LaserBeam = Container.expand(function () { var self = Container.call(this); var laserGraphics = self.attachAsset('laser', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 10; self.update = function () { self.y += self.speed; if (self.y > 2732) { self.destroy(); } }; }); var Paddle = Container.expand(function () { var self = Container.call(this); var paddleGraphics = self.attachAsset('paddle', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 20; self._move_migrated = function (direction) { self.x += direction * self.speed; }; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x000000 }); /**** * Game Code ****/ // Set a wallpaper image as the game background var wallpaper = LK.getAsset('wallpaper', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2, y: 2732 / 2 + 1650 }); game.addChild(wallpaper); var playerPaddle = game.addChild(new Paddle()); playerPaddle.x = 2048 / 2; playerPaddle.y = 2732 - 100; var jediTrainingBall = game.addChild(new JediTrainingBall()); var score = 0; var laserBeams = []; // Removed aiPaddle as it is not defined and not needed var paddles = [playerPaddle]; jediTrainingBall.x = 2048 / 2; jediTrainingBall.y = 0; var scoreTxt = new Text2('0', { size: 150, fill: "#ffffff" }); scoreTxt.anchor.set(.5, 0); LK.gui.top.addChild(scoreTxt); var targetY = playerPaddle.y; game.on('move', function (x, y, obj) { var event = obj; var pos = game.toLocal(event.global); playerPaddle.x = pos.x; }); LK.on('tick', function () { // Create laser beams from the ball if (LK.ticks % 60 === 0) { // Fire a laser every second var laserBeam = new LaserBeam(); laserBeam.x = jediTrainingBall.x; laserBeam.y = jediTrainingBall.y + jediTrainingBall.height / 2; laserBeams.push(laserBeam); game.addChild(laserBeam); } // Update laser beams for (var i = laserBeams.length - 1; i >= 0; i--) { laserBeams[i].update(); if (laserBeams[i].y > 2732) { laserBeams.splice(i, 1); } } jediTrainingBall._move_migrated(); // Removed aiPaddle logic as it is not defined and not needed for (var i = 0; i < paddles.length; i++) {} LK.setScore(score); scoreTxt.setText(LK.getScore().toString()); });
===================================================================
--- original.js
+++ change.js
@@ -26,9 +26,9 @@
};
});
var LaserBeam = Container.expand(function () {
var self = Container.call(this);
- var laserGraphics = self.attachAsset('sword', {
+ var laserGraphics = self.attachAsset('laser', {
anchorX: 0.5,
anchorY: 0.5
});
self.speed = 10;
Inside of jedi temple council room. Coruscant wallpaper.
Long laser saber. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Pale white pop-up window with chrome rounded corners in front view.
explode.
Master Yoda.
text bubble with golden lines, in front view.
white square with golden rounded corners, in front view.
Brown Lasersaber in vertical position, next to it the same horizontally. In between, there is a back-and-forth arrow and a computer mouse..