User prompt
Create a Jedi Training ball asset to the game
User prompt
Turn this game into a sword fighting game!
User prompt
rename ball to laser
User prompt
move wallpaper down with 50 units
User prompt
move wallpaper down with 100 units
User prompt
move wallpaper down with 200 units
User prompt
Move wallpaper up with 400 units
User prompt
Move wallpaper up with 500 units
User prompt
move wallpaper down with 2000 units
User prompt
move wallpaper down with 500 units
User prompt
move wallpaper down with 1000 units
User prompt
set wallpaper to the game
User prompt
Rotate the position of game from horizontal to vertical
User prompt
Rotate PADDLES from portrait to landscape
User prompt
Rotate the position of the PADDLES from horizontal to vertical
User prompt
Migrate to the latest version of LK
Remix started
Copy Classic Pong
/**** * Classes ****/ var Ball = Container.expand(function () { var self = Container.call(this); var ballGraphics = self.attachAsset('ball', { anchorX: 0.5, anchorY: 0.5 }); self.speed = { x: 10, y: 10 }; self._move_migrated = function () { self.x += self.speed.x; self.y += self.speed.y; }; }); 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.y += 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 + 1600 }); game.addChild(wallpaper); var playerPaddle = game.addChild(new Paddle()); var aiPaddle = game.addChild(new Paddle()); var ball = game.addChild(new Ball()); var paddles = [playerPaddle, aiPaddle]; var score = 0; playerPaddle.x = 2048 / 2; playerPaddle.y = 100; aiPaddle.x = 2048 / 2; aiPaddle.y = 2732 - 100; ball.x = 2048 / 2; ball.y = 2732 / 2; 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('down', function (x, y, obj) { var event = obj; var pos = game.toLocal(event.global); targetY = pos.y; }); game.on('move', function (x, y, obj) { var event = obj; var pos = game.toLocal(event.global); targetY = pos.y; }); LK.on('tick', function () { if (targetY < playerPaddle.x) { playerPaddle._move_migrated(-1); } else if (targetY > playerPaddle.x) { playerPaddle._move_migrated(1); } }); LK.on('tick', function () { ball._move_migrated(); if (ball.x < aiPaddle.x) { aiPaddle._move_migrated(-1); } else if (ball.x > aiPaddle.x) { aiPaddle._move_migrated(1); } for (var i = 0; i < paddles.length; i++) { if (ball.intersects(paddles[i])) { var hitPoint = ball.x - paddles[i].x; var hitRatio = hitPoint / paddles[i].width; ball.speed.x += hitRatio * 10; if (ball.speed.y > 0 && ball.y < paddles[i].y || ball.speed.y < 0 && ball.y > paddles[i].y) { ball.speed.y *= -1; } } } if (ball.x <= 0 || ball.x >= 2048) { ball.speed.x *= -1; } if (ball.y <= 0) { LK.showGameOver(); } if (ball.y >= 2732) { score++; ball.x = 2048 / 2; ball.y = 2732 / 2; ball.speed.x = 10; ball.speed.y = 10; } LK.setScore(score); scoreTxt.setText(LK.getScore().toString()); });
===================================================================
--- original.js
+++ change.js
@@ -42,9 +42,9 @@
var wallpaper = LK.getAsset('wallpaper', {
anchorX: 0.5,
anchorY: 0.5,
x: 2048 / 2,
- y: 2732 / 2 + 1700
+ y: 2732 / 2 + 1600
});
game.addChild(wallpaper);
var playerPaddle = game.addChild(new Paddle());
var aiPaddle = game.addChild(new Paddle());
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..