Code edit (2 edits merged)
Please save this source code
User prompt
in Player mini movements, also move forearms ans hands
User prompt
Add another button in the bottom center : gardButton
Code edit (4 edits merged)
Please save this source code
User prompt
when player hands touch enemy, move the enemy back in his current direction, not just on x
Code edit (1 edits merged)
Please save this source code
User prompt
when enmy is hit it should go back
User prompt
When a hand intersects with the opponent head implement player been hit : head should go back, flash the whole screen red
User prompt
implement player been hit : head should go back, flash the whole screen red
User prompt
implement player been hit
Code edit (13 edits merged)
Please save this source code
User prompt
Simulate punch button press and release
User prompt
Simulate punch button press and release
User prompt
no, you should do both : reduce when pressed and restore when up
User prompt
but restore the button w & h when released :)
User prompt
when punch button is pressed, reduce its w & h to simulate press
Code edit (1 edits merged)
Please save this source code
Code edit (2 edits merged)
Please save this source code
User prompt
when punching, also change the width of the head to simulate the tilt
Code edit (2 edits merged)
Please save this source code
User prompt
when punching, move of the head like boxers do
User prompt
prevent players to be too close
User prompt
add a bit of randomness to the mini movements
Code edit (1 edits merged)
Please save this source code
User prompt
when idmle, animate the players with mini movements of head and arms
===================================================================
--- original.js
+++ change.js
@@ -153,13 +153,18 @@
forearm.y -= punchDistance * 1.5; // Move forearm up for punch
forearm.rotation *= 0.5; //= -Math.PI * 0.1; //-Math.PI * 0.2
hand.x += 5; // Move hand up for punch
hand.y -= punchDistance * 2; // Move hand up for punch
- // Add head movement to mimic boxer's dodge
- self.head.x += isLeft ? 15 : -15; // Move head opposite to punching arm
- self.head.width *= 0.95; // Simulate head tilt by narrowing the width
- self.head.height *= 1.05; // Reset head width to simulate head tilt back
- self.head.rotation -= isLeft ? -0.1 : 0.1; // Simulate head tilt by narrowing the width
+ // Add head movement to mimic boxer's dodge and hit reaction
+ self.head.x += isLeft ? 15 : -15; // Move head opposite to punching arm for dodge
+ self.head.width *= 0.95; // Simulate head tilt by narrowing the width for dodge
+ self.head.height *= 1.05; // Increase head height to simulate dodge
+ self.head.rotation -= isLeft ? -0.1 : 0.1; // Tilt head for dodge
+ // Implement hit reaction
+ LK.setTimeout(function () {
+ self.head.x += isLeft ? -30 : 30; // Move head back to simulate hit reaction
+ LK.effects.flashScreen(0xff0000, 500); // Flash the whole screen red for 500ms
+ }, 100);
}, 100);
LK.setTimeout(function () {
/*
arm.height -= punchDistance;
@@ -178,20 +183,8 @@
self.head.x += isLeft ? -15 : 15; // Move head opposite to punching arm
self.head.width /= 0.95; // Reset head width to simulate head tilt back
self.head.height /= 1.05; // Reset head width to simulate head tilt back
self.head.rotation += isLeft ? -0.1 : 0.1; // Simulate head tilt by narrowing the width
- // Implement player been hit reaction
- LK.setTimeout(function () {
- if (!self.isHuman) {
- // Check if the player is not human to apply hit reaction
- self.body.tint = 0xff0000; // Change color to red to indicate hit
- self.head.tint = 0xff0000; // Change head color to red to indicate hit
- LK.setTimeout(function () {
- self.body.tint = 0xFFFFFF; // Reset color after hit
- self.head.tint = 0xFFFFFF; // Reset head color after hit
- }, 200); // Reset color after 200ms
- }
- }, 100); // Trigger hit reaction after 100ms
}, 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..