owenashurst / agar.io-clone

Agar.io clone written with Socket.IO and HTML5 canvas
MIT License
2.89k stars 1.13k forks source link

Change area you need to over take someone? #503

Open matthall1998 opened 7 years ago

matthall1998 commented 7 years ago

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

baileypumfleet commented 7 years ago

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.

matthall1998 commented 7 years ago

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

whiteyhat commented 5 years ago

Anyone solved this issue?

baileypumfleet commented 5 years ago

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

whiteyhat commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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

baileypumfleet commented 5 years ago

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.

whiteyhat commented 5 years ago

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