User prompt
add a control joystick at the bottom left
Code edit (16 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: punchDistance is not defined' in or related to this line: 'self.leftArm.height += punchDistance;' Line Number: 119
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
User prompt
log player.width when down
Code edit (3 edits merged)
Please save this source code
User prompt
set also swipeStart in 'down' event
Code edit (1 edits merged)
Please save this source code
User prompt
in punch(), move arm, forearm and hand vertically
User prompt
call Player punch() when a simple tap is made, when x is on the left half pass true
Code edit (1 edits merged)
Please save this source code
User prompt
add a function punch() to player class that takes a boolean 'isLeft'
User prompt
No, change all that : don't use a moveInterval, set change player X and Y speeds when swiping, and in player.update, update the position and progressively reduce the speed
Code edit (3 edits merged)
Please save this source code
User prompt
use a speed that decreases to make a fluid move
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: setInterval is not a function' in or related to this line: 'var moveInterval = setInterval(function () {' Line Number: 157
User prompt
Ok, make the move progressive
Code edit (3 edits merged)
Please save this source code
User prompt
Change the control system : A Swipe gives the direction of the move
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (8 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: self is undefined' in or related to this line: 'self.leftHand = self.body.attachAsset('hand', {' Line Number: 148
===================================================================
--- original.js
+++ change.js
@@ -75,14 +75,14 @@
var forearm = isLeft ? self.leftForearm : self.rightForearm;
var hand = isLeft ? self.leftHand : self.rightHand;
// Punch animation logic
LK.setTimeout(function () {
- forearm.rotation += isLeft ? -0.5 : 0.5; // Rotate forearm for punch
- hand.rotation += isLeft ? -0.5 : 0.5; // Rotate hand for punch
+ forearm.y += isLeft ? -20 : -20; // Move forearm up for punch
+ hand.y += isLeft ? -40 : -40; // Move hand up for punch
}, 100);
LK.setTimeout(function () {
- forearm.rotation -= isLeft ? -0.5 : 0.5; // Reset forearm rotation
- hand.rotation -= isLeft ? -0.5 : 0.5; // Reset hand rotation
+ forearm.y -= isLeft ? -20 : -20; // Reset forearm position
+ hand.y -= isLeft ? -40 : -40; // Reset hand position
}, 200);
};
// Update player position based on input
self.update = function () {
clear
basic light gray convex round button with a red boxing glove icon. UI
Un gant de boxe bleu vu de dessus. video game
basic light round convex gray button with a raised blue shield icon.. UI
un éclair. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
remove
a basic white heart.. game icon
A boxer has lost the match..
man boxer with red gloves is KO on the ring..