Click here to Skip to main content
15,910,981 members
Please Sign up or sign in to vote.
2.50/5 (2 votes)
See more:
Can some one help me with my if statement? (This is a example code)

MIDL
if (You.Location => new Point(Wall.Location.y = 6))
          {
          }


So its basily saying if 'You' gets to 'Wall' location that is greater then 6 on wall then do something can anyone help me here, im trying the explain this the best i can so i can get a answer, heres a like a text example

<br />
......(You).Wall 6<br />
............wall 7<br />
............wall 8<br />
............wall 9<br />
............wall 10<br />
............wall 11
Posted

1 solution

If you are comparing only Y direction then it would be

MIDL
if (wall.Location.Y >6 && You.Location.Y => Wall.Location.y))
          {
          }


is that not works?
 
Share this answer
 
Comments
[no name] 11-Feb-11 2:22am    
Well is I am just comparing Y, the cod you gave me gave me 2 errors one makes no sense and one is annoying

Error 5 Only assignment, call, increment, decrement, and new object expressions can be used as a statement C:\Users\Kyle\documents\visual studio 2010\Projects\Game 1\Game 1\Form2.cs 73 76 Game 1


and also

Error 7 Invalid expression term '=>' C:\Users\Kyle\documents\visual studio 2010\Projects\Game 1\Game 1\Form2.cs 73 58 Game 1
Albin Abel 11-Feb-11 2:34am    
What I given is a pseudo code. Tell me what is wall and what is you variables?
Albin Abel 11-Feb-11 2:38am    
replace => to >= , the correct c# syntax.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900