This forum is currently in read-only mode.
From the Asset Store
Snap to visible grid - perfect solution for any game genre
  • Well i would need to make somekind of grid movement to my new game its strategy game where u command ur troops in country and the country is divided into a sectors which you need to conquer and for that i need grid movement. So is it even possible and if it is how can i do that?

  • <img src="">

    Okay here's a pretty basic explanation based on a 64x64 grid:

    1. You select the unit (which has a green border or indicator that he can move)

    2. Four Arrow detectors are created at it's sides:

    Up: Unit.Y - 64

    Left: Unit.X - 64

    Right: Unit.X + 64

    Down: Unit.Y + 64

    3. IF the arrow overlaps harsh terrain (rock/lava/water, ect) set the arrow to Red (False) + indicate that movement is not allowed.

    4. User clicks on a arrow + Arrow is Green (True)

    Up: Set Unit.Y to Unit.Y - 64

    Left: Set Unit.X Unit.X - 64

    Right: Set Unit.X to Unit.X + 64

    Down: Set Unit.Y to Unit.Y + 64

    Is that what you kinda need?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • set position to

    (go.x,go.y is where you want it to be closest to on your grid,)

    set x to: round(go.x/64)*64

    set y to: round(go.y/64)*64

    thats basically it

  • Okay taht shuld work ty for help

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