How do I create a sprite that dynamically repeats the shape of a tile?

0 favourites
  • 8 posts
From the Asset Store
Each tile 64 by 64 pixels - Ultimate Tile Set for your awesome games
  • Hey folks! I wondered if it is possible to create a sprite that dynamically repeats the shape of the obstacle or tile (please see the attached file). Does anyone have any idea how to do that? There are many ways to use that, and it would be a great feature for platformer games.

    Tagged:

  • Not sure which one you need to repeat but if:

    1-You need to create an identical object just use the system create object >>>> your object

    2-If you need to constantly repeat the same object use "Tiled Backgrounds"

  • Ah, my mistake. I wasn't clear enough. I'm not trying to repeat the same object many times. I would like to know how to create a sprite that will mimic obstacles' shapes like a dotted circle here youtube.com/watch

  • You will likely have to look into the Drawing Canvas and some kind of "mask".

    First paste the "obstacle" objects, then you can check, pixel by pixel, if the drawing canvas is transparent, or if there is a pixel color and draw your shape accordingly to those informations.

    construct.net/en/make-games/manuals/construct-3/plugin-reference/drawing-canvas

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Kyatric, thanks for the advice!

    But I've never used the Drawing Canvas object before. That's why it looks pretty difficult to me. Maybe you know where I can find some examples or tutorials on how to do what I've described above?

  • Ah, my mistake. I wasn't clear enough. I'm not trying to repeat the same object many times. I would like to know how to create a sprite that will mimic obstacles' shapes like a dotted circle here youtube.com/watch

    Ho, I see,

    Interesting mechanics I have never seen before.

    To be honest I will keep it simple as it will be very easy to hurt performance if you are not very careful as you have many balls to check on.

    I quick and simple idea that comes to my mind will be something like this:

    Demo:

    https://www.dropbox.com/s/fglaium14kq2jd8/1-Batty%20Cave.capx?dl=0

    You can keep updating and tweaking to your needs, this is just a quick demonstration.

    Tips:

    1-You would want to keep the shapes simples (Squares, Rectangles, Circles, triangles) shape that you can easily adjust the collisions points.

    But if you need more advance then kyatrics idea will be better to detect the collisions.

    2-Donot spawn too many balls so you can keep performance nicely.

    3-On this demo the obstacles are already placed on the layout as I wanted to make a quick concept but what you would want to do is like flappy birds style that keeps spawning the obstacles on the fly, this way you will keep the object count at the minimum, so set a set of obstacles to be spawn on the runtime and then just choose randomly.

  • tarek2, that's amazing! You've done in few minutes what I was trying to do last two days. Thanks a lot!

  • tarek2, that's amazing! You've done in few minutes what I was trying to do last two days. Thanks a lot!

    No problem, I'm glad it was helpful)

    Good luck

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