In Game Level Editor Feature Help

0 favourites
  • 2 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • I'm creating an in game level editor for one of my projects and I basically have it set up so when you click on a grid cell a platform appears. This works really well but I'm wondering how I would create a sort of rectangle tool that fills an area with platforms based on the size of the area that the player draws. Think of constructs tile map system where you can fill a rectangular area with a sprite. How would I go about implementing something like this? Thanks.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Some simple logic for a rectangle fill tool might go like this...

    You'll need at least two points for inputs, those would be the corners of your rectangle. You could use the mouse coordinates on mouse clicked and on mouse released.

    Translate these coordinates to your tilemap tile values.

    Then you're going to run two for loop, for min(x1,x2) to max(x1,x2) and for min(y1,y2) to max(y1,y2), to set each tile within these bounds to the proper tile.

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