agar.io-clone icon indicating copy to clipboard operation
agar.io-clone copied to clipboard

Change area you need to over take someone?

Open matthall1998 opened this issue 7 years ago • 9 comments

How do I change the size you need to overtake someone? Right now both player needs to be in both centers.

matthall1998 avatar May 31 '17 14:05 matthall1998

I remember having this problem a little while ago. I believe that you need to go into the src/server/server.js file and you need to find the collision lines and manually increase the radius of the collision boundary.

baileypumfleet avatar Jun 07 '17 06:06 baileypumfleet

Ill do my best to find it, I don't know Java Script!

matthall1998 avatar Jun 07 '17 19:06 matthall1998

Anyone solved this issue?

whiteyhat avatar May 08 '19 16:05 whiteyhat

I have solved this issue on my local environment, just check the file I mentioned above and it should work fine

baileypumfleet avatar May 08 '19 16:05 baileypumfleet

Yes, I have been during this 33 min trying different modification on line 533. Where it is apparently where the collision takes place:

        if (collision.aUser.mass > collision.bUser.mass * 1.1  && collision.aUser.radius > Math.sqrt(Math.pow(collision.aUser.x - collision.bUser.x, 2) + Math.pow(collision.aUser.y - collision.bUser.y, 2))*2) {

I just can not achieve it, I have tried several configurations of that line but nothing 😔

whiteyhat avatar May 08 '19 16:05 whiteyhat

Yes, I have been during this 33 min trying different modification on line 533. Where it is apparently where the collision takes place:

        if (collision.aUser.mass > collision.bUser.mass * 1.1  && collision.aUser.radius > Math.sqrt(Math.pow(collision.aUser.x - collision.bUser.x, 2) + Math.pow(collision.aUser.y - collision.bUser.y, 2))*2) {

I just can not achieve it, I have tried several configurations of that line but nothing 😔

My information is based on commit https://github.com/huytd/agar.io-clone/pull/248/commits/8883ef013938590cee9405476de28651d0001ff7

whiteyhat avatar May 08 '19 16:05 whiteyhat

@bpflt If you could share the specific line where fix this issue would be great

whiteyhat avatar May 08 '19 17:05 whiteyhat

I made that fix years ago on a machine which I no longer have so won't be able to share, but I'll have a look into it at some point soon and see if I can fix.

baileypumfleet avatar May 09 '19 09:05 baileypumfleet

Cool. No worries I found a different repository with better upgrades including this feature

whiteyhat avatar May 10 '19 09:05 whiteyhat