How to create a custom sprite position on tilemap position ?

0 favourites
  • 3 posts
From the Asset Store
This is a black tileset with 2 tilemaps, props, one animated character and more.
  • I want to make a system of customization of the position of game objects following the UID positions of the floor tileset, as in the game Stardew Valley, I have already defined its size and obtained the uid of each one, I would like to know if it was possible to edit the position in the grab and drop style, but with the movement to be dragged it was inside the tilemap, like this in gridx 10 grid y 10, I move to the right and it gets grid x 11 and grid y 10 so that makes it automatic in the grab style and release, and achieve the condition of release only if you are in an acceptable place without overlapping objects or outside the limits of the editing area

  • In this sudoku game I also need to restrict to drop area's, you can check out how it's done.

    youtu.be/Rq0iQGcVQtc

    it doesn't use tilemaps however, but invisible sprites that act as placeholders. May that can be an alternative?

    Hope that helps in any way

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If I understood your question correctly, you can use SnapX and SnapY expressions. For example:

    Sprite is dragging:
    Sprite set position to Tilemap.SnapX(Sprite.X), Tilemap.SnapX(Sprite.X)
    

    You can also add clamp to limit the movement to tilemap area:

    Tilemap.SnapX(clamp(Sprite.X, Tilemap.BBoxLeft, Tilemap.BBoxRight))

    Tilemap.SnapY(clamp(Sprite.Y, Tilemap.BBoxTop, Tilemap.BBoxBottom))

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