Giter VIP home page Giter VIP logo

Comments (6)

Afforess avatar Afforess commented on June 12, 2024

This sounds easy enough, but I need a bit of clarification: what constitutes a connected tile? Does a tile have to be directly North, East, South, or West to be connected. Or can it be a corner tile (NE, SE, NW, SW?)

from factorio-stdlib.

mojo2012 avatar mojo2012 commented on June 12, 2024

As you see in this screenshot, it's not really possible to make conneted tiles in the diagonal directions:
bildschirmfoto 2016-07-13 um 09 07 50

So for now I would stay with N, W, S, E - basically what is visually connected.

from factorio-stdlib.

Afforess avatar Afforess commented on June 12, 2024

Okay, I just added Tile.adjacent, please take a look and see if it fits what you are describing. For your use-case, I imagine you could use this:

local connected_tiles = Tile.adjacent(surface, position, false, 'moat')
for _, adj_pos in pairs(connected_tiles) do
   ... do stuff
end

from factorio-stdlib.

Afforess avatar Afforess commented on June 12, 2024

@mojo2012

I've tested out the Tile.adjacent a bit and it seems solid. Just checking in to see if it matches what you were thinking about.

from factorio-stdlib.

Afforess avatar Afforess commented on June 12, 2024

Closing unless @mojo2012 reports any discoveries.

from factorio-stdlib.

mojo2012 avatar mojo2012 commented on June 12, 2024

Sorry, was too busy. I try to report back this week

from factorio-stdlib.

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.