Code edit (1 edits merged)
Please save this source code
User prompt
Lower the background down pause button
User prompt
scale it from top down little below the pause button
User prompt
Scale the background from bottom to pause button and to the screen left right boundaries
User prompt
Change to another "time new roman" font
User prompt
Make the font for any text in this game "Time new roman"
User prompt
Make the level text bigger
User prompt
Add text Level 1 with white color on the top right
User prompt
Add background1 to the game and make this first level level 1.
User prompt
Increase the distance movement of player more
Code edit (1 edits merged)
Please save this source code
User prompt
Increase distance of player movment more
User prompt
Remove diagonal player movement
User prompt
Make the player movement smooth ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Add more distance for the player and speed
User prompt
Remove all object let only player and its movement and background1
User prompt
Rest player position to the bottom left 2.2 2.2
User prompt
Please fix the bug: 'Cannot read properties of undefined (reading 'x')' in or related to this line: 'game.mouse.x = playerNode.x;' Line Number: 34
User prompt
Rest cursor to the player when game start Make the player small 1.5 1.5
User prompt
Please fix the bug: 'TypeError: Cannot set properties of undefined (setting 'x')' in or related to this line: 'game.mouse.x = playerNode.x;' Line Number: 98
User prompt
Make the cursor go to player when on the game screen
User prompt
Remove player movements
User prompt
player not following the cursor when it is close to it!
User prompt
Increase speed of player
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'x')' in or related to this line: 'var dx = game.mouse.x - playerNode.x;' Line Number: 110
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); /**** * Classes ****/ // Class for the player character var Player = Container.expand(function () { var self = Container.call(this); var playerGraphics = self.attachAsset('player', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 10; // Increase player's speed attribute self.update = function () { // Player update logic }; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x000000 //Init game with black background }); /**** * Game Code ****/ // Initialize player var player = new Player(); player.x = 100; player.y = 100; game.addChild(player); // Handle player movement // Import tween plugin game.down = function (x, y, obj) { var targetX = x; var targetY = y; var dx = targetX - player.x; var dy = targetY - player.y; if (Math.abs(dx) > Math.abs(dy)) { // Move horizontally tween(player, { x: player.x + Math.sign(dx) * player.speed * 3 }, { duration: 500 }); } else { // Move vertically tween(player, { y: player.y + Math.sign(dy) * player.speed * 3 }, { duration: 500 }); } };
===================================================================
--- original.js
+++ change.js
@@ -43,16 +43,16 @@
var dy = targetY - player.y;
if (Math.abs(dx) > Math.abs(dy)) {
// Move horizontally
tween(player, {
- x: player.x + Math.sign(dx) * player.speed * 2
+ x: player.x + Math.sign(dx) * player.speed * 3
}, {
duration: 500
});
} else {
// Move vertically
tween(player, {
- y: player.y + Math.sign(dy) * player.speed * 2
+ y: player.y + Math.sign(dy) * player.speed * 3
}, {
duration: 500
});
}