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,18 +153,13 @@
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 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);
+ // 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
}, 100);
LK.setTimeout(function () {
/*
arm.height -= punchDistance;
@@ -298,7 +293,14 @@
// Game update function
game.update = function () {
// This section has been removed to prevent redundant player movement handling.
// Spawn enemies
- // Check for collision with player
- // Removed game over trigger to prevent ending the game on player collision with enemy
+ // Check for collision between player's hand and enemy's head
+ if (player.leftHand.intersects(enemy.head) || player.rightHand.intersects(enemy.head)) {
+ // Player hit reaction: head goes back, flash screen red
+ enemy.head.y -= 20; // Head goes back
+ LK.effects.flashScreen(0xff0000, 500); // Flash the whole screen red for 0.5 seconds
+ LK.setTimeout(function () {
+ enemy.head.y += 20; // Head returns to normal position
+ }, 500);
+ }
};
\ No newline at end of file
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..