Negative Decimals and X Movement

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • I want to make my platformer character move slightly faster, as he is pretty slow. He moves 1 pixel every frame, and I want him to move about 1.2 pixels every frame. So I do this, and I'm pretty sure it works fine whenever he's going right (when the X Velocity is positive.) However, whenever he goes left (when the X Velocity is negative) It seems to round to 2 pixels every frame. I already know decimals are generally really weird in Clickteam, so I'm not too surprised. Does anyone know how to help with this?

  • Fusion will only ever move an object by whole pixels, and rounded down (technically FLOOR() not ROUND()). The solution is to store the intended x/y coordinates as an alterable value in the object, and then add/subtract to those when you set the new position of the object

    Please login to see this attachment.

  • Fusion stores position as an integer so it wraps any expression you give in Set Position X/Y with an Int() which removes the decimal point (Like Floor(), but different), hence why you see the increase in speed when going left.

    - BartekB

    Join the Click Converse Discord! - Please login to see this link.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!