Mouse Grid Movement

  • Hello,

    I want to modify the cursor to move like it would be in a grid. I want the layer to be 1 grid consisting of squares and the cursor can only move from square to square. The grid should only be visible in a range of 1 square around the square, in which the player sprite is displayed. (2D Platform view, not Top down) Furthermore I want to be able to know on which square the player clicked to do further things.

    I hope you understand what I mean and can help me to accomplish this.

    Best Regards,

    Astrosus.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • This is what I would do. It would be helpful if you had a .capx, but I can try to explain without it.

    1. Set the cursor style to none.

    2. Create a sprite to act as your cursor.

    3. Make a Every Tick Command, and set the sprite to this X/Y Coordinates:

    X: round((Mouse.X - 16) / 32) * 32 + 16

    Y: round((Mouse.Y - 16) / 32) * 32 + 16

    I hope this helps.

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