Giter VIP home page Giter VIP logo

Comments (3)

silverchiren avatar silverchiren commented on August 16, 2024

Okay, lots of tweaking and experimenting later. Will just put here what I have the lines mentioned above set to

Left Wall:
if (player[0].x < 1000 && badAngles.length > 0) {
var newX = -300 - screenDistance();

Top Wall:
if (player[0].y < 1000 && badAngles.length > 0) {
var newY = -300 - screenDistance();

Right Wall:
if (player[0].x > 10200 && badAngles.length > 0) {
var newX = 11500 + screenDistance();

Bottom Wall:
if (player[0].y > 10200 && badAngles.length > 0) {
var newY = 11500 + screenDistance();

from agar.io-bot.

Apostolique avatar Apostolique commented on August 16, 2024

What you did can be considered a temporary fix. The real problem comes from the way I calculate angles when a player is inside an enemy. Right now, I create a fake enemy right on the other side of the wall. Sometimes, the enemy is too close to the wall and big enough to completely cover the bot. An easier way to fix this would be to simply move the wall enemy further behind the wall based on the size they are set to.

from agar.io-bot.

silverchiren avatar silverchiren commented on August 16, 2024

Yeah, my fix even stops working if the cell gets too big. I'm going to try one more thing!
Seeing if this works:
var newY = 11350 + (player[0].size * .5) + screenDistance();
var n = new ya(wallI, player[0].x, newY, player[0].size + 100, "#000", false, "Bottom Wall");

Theory; the fake enemy should always be at least more than the player's radius away from the player
(playersize/2)+150, the playersize+100 should not make its radius more than 150 more than the player's radius
This system has resulted in no issues with getting stuck, or browser crashes. Been running it this way for ~2 hours

from agar.io-bot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.