Code edit (3 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'x')' in or related to this line: 'var boxX = box.x - box.width * box.anchor.x;' Line Number: 153
User prompt
in customBoxCircleIntersect, take into acount the box anchors in corners calculation
Code edit (5 edits merged)
Please save this source code
User prompt
log the corners coordinates in customBoxCircleIntersect
Code edit (4 edits merged)
Please save this source code
User prompt
in customBoxCircleIntersect, simply use box corners coordinates and compare circle position to them
Code edit (3 edits merged)
Please save this source code
User prompt
in game update, add the treatment of net colision using customBoxCircleIntersect
User prompt
create a new function customBoxCircleIntersect
Code edit (2 edits merged)
Please save this source code
User prompt
un peu après que la balle ne touche le sol, augmenter le score (si à gauche +1 pour player 2, si à droite +1 pour player 1) et faire un Reset de la bale
Code edit (1 edits merged)
Please save this source code
Code edit (10 edits merged)
Please save this source code
User prompt
in customIntersect, if circle2 has a parent, use parent position + circle2 relative position
Code edit (2 edits merged)
Please save this source code
User prompt
log player colision in gmae update
Code edit (2 edits merged)
Please save this source code
User prompt
intersects doesn't produce satifying results, use the fact that ball is a circle and collisionBody too to implement a custom intersections function names customIntersect (don't forget collisionBody relative position)
Code edit (1 edits merged)
Please save this source code
User prompt
you removed all rotation ! I only said to re-check if there isn't too much, not to rermove all
User prompt
recheck if rotation isn't updated in too much places
User prompt
a contact doesn't mean the ball should become an helicopter! review the magnitude of rotation on contact
User prompt
rotation increase on contacts but doesn't stop directly just after, it decreases gradually
User prompt
rotation speed should not increase just because of the fall, only on contacts
===================================================================
--- original.js
+++ change.js
@@ -173,12 +173,13 @@
LK.gui.topRight.addChild(scoreTxt2);
game.update = function () {
if (!ballCanMove && (player1.collisionBody && customIntersect(ball, player1.collisionBody) || player2.collisionBody && customIntersect(ball, player2.collisionBody) || customIntersect(ball, player1) || customIntersect(ball, player2))) {
ballCanMove = true;
+ console.log("Player collision detected 1");
}
// Check for collisions with players
if (customIntersect(ball, player1.collisionBody) || customIntersect(ball, player2.collisionBody)) {
- console.log("Player collision detected");
+ console.log("Player collision detected 2");
var player = customIntersect(ball, player1.collisionBody) ? player1 : player2;
var collisionAngle = Math.atan2(ball.y - player.y, ball.x - player.x);
var speed = Math.sqrt(ball.speedX * ball.speedX + ball.speedY * ball.speedY);
var playerSpeed = Math.sqrt(player.speedX * player.speedX + player.speedY * player.speedY);
white volley ball.
top view of a concave blue (0xADD8E6) plastic button. 4 small black directionnal chevrons engraved : right, left, top , bottom.. Photorealistic
Beach ball. photo
full view of a Beach white towel with colored infinte logo. placed on the sand. photo
Start button in the shape of a white beach volleyball with « START » written on it in black. Photo