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
On Arduino theres the Map function, it gets a range and converts it inside another range (this page shows it https://www.arduino.cc/reference/en/language/functions/math/map/ )
Is there any similar function on Construct? I want to control a object using the accelerometer, so everytime the phone is in a flat surface it gets to the middle and as you tilt it the object goes to the edges.
Thanks in advance!
Develop games in your browser. Powerful, performant & highly capable.
Offhand you can do the math directly to map x from a,b to c,d.
X = c+(d-c)*(X-a)/(b-a)
Or if you want to use some built in expressions you could do this.
X = lerp(c, d, unlerp(a, b, x))