1

I'm trying to make a weirdo edition of PacMan and I need a quick way to .draw all the points (diamonds) across the whole map. My idea was to draw a point every x,y with a loop and then check which of those collide with a wall and delete them. The only problem is that I have no idea about how to get the Fixture of the walls. I used Tiled with STI lib and made an collidable Object Layer. I'm a noob and I don't know which information you need in order to help me, just tell me what you need to know. Thank you so much

Tiled In-Game SS

function Coin.beginContact(a, b, collision)
    for i,instance in ipairs(ActiveCoins) do
        if a == instance.physics.fixture or b == instance.physics.fixture then
            if a == Player.physics.fixture or b == Player.physics.fixture then
                instance.toBeRemoved = true
                return true
            elseif a == map.layers.Solid or b == map.layers.Solid then
                instance.toBeRemoved = true
                return true
            end
        end
    end
end

This is how I check collision between Player and Coins, in the elseif I tried to experiment in order to get the fixture of the walls, but nada.

Jason Aller
  • 3,541
  • 28
  • 38
  • 38
  • Feels a bit overkill imo. You have tiles, with full, grid aligned collisions. That means you can skip collision all together, you just need to check the tiles type. E.g. tiles[x][y] == "floor" pseudocode. – Luke100000 Dec 07 '22 at 13:23
  • I'm not sure If I undestood – Tomasz Michal Juraszek Dec 07 '22 at 14:46
  • Get the properties of the specific tile https://karai17.github.io/Simple-Tiled-Implementation/modules/sti.html#Map:getTileProperties and only place a point if the tile is a floor – Luke100000 Dec 07 '22 at 17:30

0 Answers0