Hundreds of features to explore
Games made in Construct
Your questions answered
Trusted by schools and universities worldwide
Free education resources to use in the classroom
Students do not need accounts with us
What we believe
We are in this together
World class complete documentation
Official and community submitted guides
Learn and share with other game developers
Upload and play games from the Construct community
Game development stories & opinions
how to measure the distance between the object and the cursor only in X? desirable that the object was a point of "0" (the origin point)
What about maths ?
Object.X - Mouse.X
(or the opposite, depends on what exactly you're wanting to do)
The "Distance" function will work fine too:
distance(x1, y1, x2, y2)
or in your case, something like this:
distance(Object.X, Object.Y, Mouse.X, Mouse.Y)
CodeMasterMike: He only wanted the "X" distance.
Oh, I missed that part, sorry.
I have a ball, which should turn left or right, depending on whether - left or right of the cursor on the ball. How can I do?
Develop games in your browser. Powerful, performant & highly capable.
RACR2:
Try something like
Cursor.X < Ball.X
-- Go right
Else
-- Go left
RACR2: Try something like Cursor.X < Ball.X -- Go right Else -- Go lefthow to set the direction of rotation of an object?
-- Go lefthow to set the direction of rotation of an object?
oops, already knew ^^"