How do I Remove Decimals

0 favourites
  • 5 posts
From the Asset Store
Customize the animation of character when item changed
  • I don't exactly know how to phrase my problem. My problem is: I'm trying to make a golf game and to make it I want power, and to make it slightly more difficult I randomly choose a number 1-10 every 0.2 seconds for the power, and when you click it moves a certain distance based on the power, but I can't display the number because it's being set to numbers with decimals like 1.4330501577351242 or 9.736560676712543. I tried setting the option to 1-1.99999999999999 or 9-9.999999999999 but it doesn't work. Can anybody help?

  • Make sure to read the manual carefully, especially the System Expressions section regarding numbers.

    The parts that should be of interest to you are such things as Int and Round (especially Round for your case), although you may then decide to try Floor or Ceiling.

    Have a look and get back to us if you still have a problem.

  • Make sure to read the manual carefully, especially the section regarding numbers.

    The parts that should be of interest to you are such things as Int and Round (especially Round for your case), although you may then decide to try Floor or Ceiling.

    Have a look and get back to us if you still have a problem.

    Round seems very useful but how do you use it for a variable?

  • Every 0.2 seconds -> Set variable to: round(random(1,10))

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Every 0.2 seconds -> Set variable to: round(random(1,10))

    Thank you so much!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)