Code edit (16 edits merged)
Please save this source code
User prompt
in handleHit, fix Head & torso back movement timout scope problem with
Code edit (3 edits merged)
Please save this source code
User prompt
in handleHit, when !defenser.isGuarding, flash the defenser in red
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
User prompt
in handleHit, if defenser isn't withinLimits, move the attacker back
User prompt
in handleHit, use the ring border properties to check if within borders
User prompt
in Ring class, replace the limits array, by properties : leftBorder, rightBorder, topBorder and bottomBorder
Code edit (21 edits merged)
Please save this source code
User prompt
now, in handleHit(), check if newX and newY are out of ring's limits
User prompt
store the following coordinates as ring limits properties in ring class : [300,200], [1800,200], [300,1750], [1800,1750]
Code edit (1 edits merged)
Please save this source code
Code edit (9 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: target is not defined' in or related to this line: 'self.targetX = target.x;' Line Number: 223
Code edit (1 edits merged)
Please save this source code
Code edit (7 edits merged)
Please save this source code
User prompt
factorize punch() function by using the deltas method
Code edit (1 edits merged)
Please save this source code
Code edit (6 edits merged)
Please save this source code
User prompt
in guard() adjustments, handle also width and height (deltaW and deltaH)
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
in guard(), also add a deltaY to adjustments array
===================================================================
--- original.js
+++ change.js
@@ -510,12 +510,10 @@
var defenserDirection = Math.atan2(defenser.y - attacker.y, defenser.x - attacker.x);
// Move defenser back
var newX = defenser.x + Math.cos(defenserDirection) * backDelta;
var newY = defenser.y + Math.sin(defenserDirection) * backDelta;
- // Check if newX and newY are within ring's limits
- var withinLimits = ring.limits.some(function (limit) {
- return newX >= limit.x && newX <= limit.x + ring.width && newY >= limit.y && newY <= limit.y + ring.height;
- });
+ // Check if newX and newY are within ring's borders
+ var withinLimits = newX >= ring.leftBorder && newX <= ring.rightBorder && newY >= ring.topBorder && newY <= ring.bottomBorder;
log("Is in ring ?", withinLimits);
if (withinLimits) {
defenser.x = newX; // Move defenser back in the x direction of current movement
defenser.y = newY; // Move defenser back in the y direction of current movement
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..