Mouse Grid Movement

Get help using Construct 2

Post » Tue Jul 02, 2013 10:35 pm


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.Astrosus2013-07-02 22:48:16
Posts: 110
Reputation: 1,463

Post » Tue Jul 02, 2013 11:24 pm

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.
Posts: 50
Reputation: 2,765

Return to How do I....?

Who is online

Users browsing this forum: Kenthria, Yahoo [Bot] and 11 guests