Hundreds of features to explore
Games made in Construct
Your questions answered
Popular & trusted by schools and Universities world-wide
Construct 3 runs in the browser & works offline
Students do not need accounts with us
Our educational partners
Free education resources to use in the classroom
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
I'm making a puzzle game where you have to fit geometrical forms in a bigger form, similar to tangram. Since i'm going to transfer it to touch devices i'm using Dragn&Drop and i need to make the pieces rotate so i made a double tap function. I made a global variable to count the number of movements, so when i drag it i add +1 to it, but when I just tap or double-tap the piece it counts as movements aswell... I don't know why it's counting since i'm not moving it, can someone help me? Thanks!
You could always have the variable save the objects X,Y coordinates instead and then compare them when its dropped to +1 a moved variable if they are different than the stored ones. You could then use this variable to make the object "pop" back if they dropped it in an invalid location.
That's a really good idea. But i just started with construct so i don't really know how to do it, could you explain a little more? Which behavior is better to compare positions?
Develop games in your browser. Powerful, performant & highly capable.
You dont use behaviours for that.
Just save X and Y to global variable and then compare them (if new X and Y is not Saved.X, Saved.Y then add 1 to score).
Global and instance variables tutorials are very well written, check them out!
You would gather the information into a variable through the actions of an event. To get the X and Y values of an object click on the window that has its opacity reduced whenever your doing conditions/actions. This window contains all objects in your project. Find the object referenced in the condition the actions are being generated from and scroll down to X and Y... it will then read something like objectname.X in the field of the variable instead of a number.
If you post a .capx of what you have so far.. or just the part where your dragging and rotating the piece I can edit it for you to look at visually.