Edge Detection example

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • This is a feature I needed in my game, so I decided to make an example of it. This uses a surface object as a collision mask in order to gather data about the surroundings of each tile, and changes the animation frame of the tile based on those around it. With this engine, you can just place tiles into your game and it will automatically change to the correct tile so you can have nice looking borders for your games :)

    The engine itself uses bitmasks, which is a fairly simple idea once you understand it. It looks complicated, but it's rather basic. I add the red coefficient of the grid cell to the right of each tile, divided by 255, to give 0 if there is no tile and 1 if there is. Then, I do the same for the cell to the upper right, but I add 2 instead of 1. For the cell directly above, I add 4. As it goes around the tile, I add a doubling amount each time, moving to 8, 16, 32, 64, and eventually 128. This means I can set the animation frame to this value and will always have the proper position data. For frame 50, which is 32+16+2, I can tell that the bottom left, left, and top right cells adjacent to the cell I am looking at have obstacles in them. So frame 50 would leave those sides of the cell open, whilst closing the other ones. Take a look at the example.swf file to see what this is actually accomplishing :)

    If anyone would like a better explanation, just ask and I'll try to be more in-depth. Have fun!


    Attachments
    Please login to see this link. [size:8pt](666 downloads, build 252)[/size]
    Please login to see this link. [size:8pt](1337 downloads, build 252)[/size]

    For a list of my achievements, hit up Please login to see this link..com/
    Unless you want to party, then go to Please login to see this link.

  • I have updated the example SWF with a new file which shows how it looks with actual game graphics :) Same link, Please login to see this link.

    For a list of my achievements, hit up Please login to see this link..com/
    Unless you want to party, then go to Please login to see this link.

  • To make this actually usable for other people (and myself) I have created a Tile Generator. Using the surface object, you merely have to draw the edges of the tile and it will build you the result tiles and save all 256 of them to the directory the app is run from. Save before running, so it doesn't just put them in a temp directory.

    Attachments
    Please login to see this link. [size:8pt](i downloads, build 253)[/size]

    For a list of my achievements, hit up Please login to see this link..com/
    Unless you want to party, then go to Please login to see this link.

  • Thanks! I'm going to update this with a new little engine for slopes I've been working on sometime between now and later.

    For a list of my achievements, hit up Please login to see this link..com/
    Unless you want to party, then go to Please login to see this link.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!