User prompt
Add yellowstone asset to the game
User prompt
Add redstone asset to the game
User prompt
REMVE TARGET FROM THE GAME
User prompt
Reset the blue target asset! I didn't want to delete it from the game!!
User prompt
Move the red line down with 150 units
User prompt
Move the red line down with 200 units
User prompt
rotate the bluestone asset with 5 degrees
User prompt
Move the red line down with 100 units
User prompt
Add a lane asset to each side of the track
User prompt
do it
User prompt
doit
User prompt
In order of display, center line and target line appear below target, whitering, redring, whitecenter.
User prompt
In order of display, center line and target line appear above target, whitering, redring, whitecenter.
User prompt
Add white center asset to the game. the center is on the target center.
User prompt
Add white center to the game. the center is on the target center.
User prompt
Add red ring to the game. the center is on the target center.
User prompt
Add white ring to the game. the center is on the target center.
User prompt
In display order, the player is above as the target
User prompt
Take gameover out of game
User prompt
move the center of target to the center of targetline!
User prompt
Move the game's horizontal targetline to the upper quadrant of the map.
User prompt
Add grey horizontal targetline to the game, to the center of the map
User prompt
Add grey horizontal centerline to the game, to the center of the map
User prompt
Add thin grey horizontal centerline to the game, center of the map
User prompt
Add grey horizontal line to the game to the center of the map
/**** * Classes ****/ // The assets will be automatically created and loaded by the LK engine // Create a class for the curling stone var CurlingStone = Container.expand(function () { var self = Container.call(this); var stoneGraphics = self.attachAsset('blueStone', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 0; self.direction = 0; self.update = function () { self.x += Math.cos(self.direction) * self.speed; self.y += Math.sin(self.direction) * self.speed; self.speed *= 0.99; // friction if (self.speed < 0.1) { self.speed = 0; } }; self["throw"] = function (speed, direction) { self.speed = speed; self.direction = direction; }; }); var RedStone = Container.expand(function () { var self = Container.call(this); var stoneGraphics = self.attachAsset('redStone', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 0; self.direction = 0; self.update = function () { self.x += Math.cos(self.direction) * self.speed; self.y += Math.sin(self.direction) * self.speed; self.speed *= 0.99; // friction if (self.speed < 0.1) { self.speed = 0; } }; self["throw"] = function (speed, direction) { self.speed = speed; self.direction = direction; }; }); var YellowStone = Container.expand(function () { var self = Container.call(this); var stoneGraphics = self.attachAsset('yellowStone', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 0; self.direction = 0; self.update = function () { self.x += Math.cos(self.direction) * self.speed; self.y += Math.sin(self.direction) * self.speed; self.speed *= 0.99; // friction if (self.speed < 0.1) { self.speed = 0; } }; self["throw"] = function (speed, direction) { self.speed = speed; self.direction = direction; }; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0xFFFFFF // Init game with white background }); /**** * Game Code ****/ // Add center line to the game var centerLine = LK.getAsset('centerLine', { anchorX: 0.5, anchorY: 0.0, x: 2048 / 2, y: 0 }); // Add left lane to the game var leftLane = LK.getAsset('leftLane', { anchorX: 0.5, anchorY: 0.0, x: 50, y: 0 }); game.addChild(leftLane); // Add right lane to the game var rightLane = LK.getAsset('rightLane', { anchorX: 0.5, anchorY: 0.0, x: 2048 - 50, y: 0 }); game.addChild(rightLane); // Add red horizontal line to the lower quarter of the map var redLine = LK.getAsset('redLine', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2, y: 2732 * 0.75 + 250 }); // Add grey horizontal target line to the upper quadrant of the map var targetLine = LK.getAsset('targetLine', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2, y: 2732 * 0.25 }); var whiteRing = LK.getAsset('whiteRing', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2, y: 2732 * 0.25 }); game.addChild(whiteRing); var redRing = LK.getAsset('redRing', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2, y: 2732 * 0.25 }); game.addChild(redRing); var whiteCenter = LK.getAsset('whiteCenter', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2, y: 2732 * 0.25 }); game.addChild(whiteCenter); game.addChild(centerLine); game.addChild(redLine); game.addChild(targetLine); var stone = game.addChild(new CurlingStone()); stone.x = 2048 / 2; stone.y = 2732 - 150; var redStone = game.addChild(new RedStone()); redStone.x = 2048 / 2 + 100; // Position it slightly to the right of the blue stone redStone.y = 2732 - 150; var yellowStone = game.addChild(new YellowStone()); yellowStone.x = 2048 / 2 - 100; // Position it slightly to the left of the blue stone yellowStone.y = 2732 - 150; // Initialize the game state var throwing = false; var throwStart = null; // Handle touch events game.down = function (x, y, obj) { throwing = true; throwStart = { x: x, y: y }; }; game.up = function (x, y, obj) { if (throwing) { var dx = x - throwStart.x; var dy = y - throwStart.y; var speed = Math.sqrt(dx * dx + dy * dy) / 100; var direction = Math.atan2(dy, dx); stone["throw"](speed, direction); throwing = false; } }; // Update the game state game.update = function () { // Removed game over condition when stone intersects target };
===================================================================
--- original.js
+++ change.js
@@ -44,8 +44,29 @@
self.speed = speed;
self.direction = direction;
};
});
+var YellowStone = Container.expand(function () {
+ var self = Container.call(this);
+ var stoneGraphics = self.attachAsset('yellowStone', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.speed = 0;
+ self.direction = 0;
+ self.update = function () {
+ self.x += Math.cos(self.direction) * self.speed;
+ self.y += Math.sin(self.direction) * self.speed;
+ self.speed *= 0.99; // friction
+ if (self.speed < 0.1) {
+ self.speed = 0;
+ }
+ };
+ self["throw"] = function (speed, direction) {
+ self.speed = speed;
+ self.direction = direction;
+ };
+});
/****
* Initialize Game
****/
@@ -122,8 +143,11 @@
stone.y = 2732 - 150;
var redStone = game.addChild(new RedStone());
redStone.x = 2048 / 2 + 100; // Position it slightly to the right of the blue stone
redStone.y = 2732 - 150;
+var yellowStone = game.addChild(new YellowStone());
+yellowStone.x = 2048 / 2 - 100; // Position it slightly to the left of the blue stone
+yellowStone.y = 2732 - 150;
// Initialize the game state
var throwing = false;
var throwStart = null;
// Handle touch events
black curling stone with pink top, top view.
Black curlingstone with purple top, top view.
Black curlingstone with yellow top, top view.
Black curlingstone with orange top, top view.
black curlingstone with neongreen top, top view.
Black curlingstone with neonblue top, top view.
add a text to the center: "Player vs Player"
neongreen rectangle with rounded corners, transparent in the middle.
Red button with white start text.