Computer Science Canada Zomg Ir N00b |
Author: | Argus [ Wed Jun 24, 2009 11:39 am ] | ||
Post subject: | Zomg Ir N00b | ||
What is it you are trying to achieve? Making my own collision detection What is the problem you are having? Operands of Boolean operators must be boolean, higlights the variable c in the if statement Describe what you have tried to solve this problem changed variable c to boolean, didnt work Post any relevant code (You may choose to attach the file instead of posting the code if it is too long) Code tehre
Please specify what version of Turing you are using 4.1.1a or sumthing like that |
Author: | DemonWasp [ Wed Jun 24, 2009 12:05 pm ] | ||||||||
Post subject: | RE:Zomg Ir N00b | ||||||||
Well, the solution depends on what you're trying to do. Let's break up the if-statement's condition first:
The above doesn't make any sense. Why not? Well, suppose x is 15 and b is 12. Then what you're asking is "if 27 then...", and that's just nonsense. Similarly,
doesn't make any sense. You'll be happy to know that
makes sense - because it has a comparison operation in it. Instead of asking "if 27", you're asking "if 27 is greater than 15, then...". At a guess, you were expecting it to compare (x+b) and (y+a) to (d-c) and (e-c). In that case, you want this:
|
Author: | Argus [ Wed Jun 24, 2009 5:24 pm ] |
Post subject: | RE:Zomg Ir N00b |
ok my sprites are centeed and i want it to be like if the top right corner is in between 2 points in the other sprite then its a hit |