Is there anything like a flood fill algorithm for the transparent part of a png image?

  • So I wanted to do a maze game. after designing the maze in photoshop, I save it as png but of course when I export it to C3 or Unity, the program doesn't recognize the walls and gives it one collision box. Is there anything like an algorithm that detects the parts of a png file with transparency and flood fill the rest of the image? The result would be creating another layer with tiles overlapping the original layout but with the right collision box so that you can make it invisible and solve the problem.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I don't think so

    However you could definitely use a tilemap for this

    Insert a blank tilemap over your maze, then 'paint' all the tiles that make up the walls of your maze

  • Not only does kidswithcrowns give a solution it is the best way do create game levels like mazes for you can easily build more mazes within construct and you projects file and builds will be much smaller if done efficiently.

    If you insist on using a single image to create your maze you would have to make and invisible sprite and cover the borders which isn't as annoying as it sounds, just copy, paste, and shape. This may be the best option if your puzzle has arches. Even with tools like construct work is always involved in game development.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)