Skip to content
Advertisement

Tag: collision-detection

detect collision between two circles and sliding them on each other

I’m trying to detect collision between two circles like this: Now when collision is detected I want to slide the circle1 from on the circle2 (circle1 is moving) like this: –circle1———————————circle2————————- I could do this by updating the angle of circle1 and Moving it toward the new angle when collision is detected. Now My question is that how can I

Collision in canvas javascript game

I added collision to my game but I have a problem. But first I´ll give you some background. I have this: On update(); function I have this: That is used here: Note: wPlayer and hPlayer are the width and height of the player, as the animation is done through a spritesheet. xPlayer and yPlayer are the positions of the Player

Advertisement