Computer Science Canada Real/Int problems (to do with Math.Distance) |
Author: | pttptppt [ Fri Feb 24, 2017 8:04 pm ] | ||
Post subject: | Real/Int problems (to do with Math.Distance) | ||
What is it you are trying to achieve? I'm making a game similar to Diep.io. Basically as the user moves, depending on the direction of movement, little bullets will shoot. Now my program still requires work but I have a big problem. What is the problem you are having? The only methods Ive found for achieving the goal of "shooting" is using "Math.Distance" from this thread: http://compsci.ca/v3/viewtopic.php?t=30017. The problem is that if the values are not real, then Math.Distance doesn't work. Describe what you have tried to solve this problem I've tried using the Round command but after rounding and whatnot, it tells me that it has no value. So either the "Assigned values are the wrong type" or "It has no value" Post any relevant code (You may choose to attach the file instead of posting the code if it is too long) The problematic code is highlighted with a lot of percent signs.
Please specify what version of Turing you are using Latest [url][/url] |
Author: | Insectoid [ Sat Feb 25, 2017 1:42 pm ] |
Post subject: | RE:Real/Int problems (to do with Math.Distance) |
Math.Distance works with integers. Any function that takes reals as input will also accept integers. Even if you couldn't do that, the Math.Distance function is nothing more than a^2 + b^2 = c^2. You could write your own version in one line of code. |
: |