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
User prompt
in Player class, add the hands
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
User prompt
in Player, add the forearms
===================================================================
--- original.js
+++ change.js
@@ -78,14 +78,14 @@
// Punch animation logic
LK.setTimeout(function () {
arm.height += punchDistance;
forearm.y -= punchDistance; // Move forearm up for punch
- hand.y -= punchDistance * 2; // Move hand up for punch
+ hand.y -= punchDistance * 1.5; // Move hand up for punch
}, 100);
LK.setTimeout(function () {
arm.height -= punchDistance;
forearm.y += punchDistance; // Reset forearm position
- hand.y += punchDistance * 2; // Reset hand position
+ hand.y += punchDistance * 1.5; // 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..