c# - Comparing int's and Vector2's -


i'm trying compare int vector2 position in if statement in code, error: operator '<=' can not applied operands of type 'microsoft.xna.framework.vector2' , 'int'.

here code snippet:

            (int = 0; < position.count(); i++)              if (position[i] < positiontracker)             {                 mspeed.x = wizardspeed;                 mdirection.x = move_left;             } 

as error says there no comparison defined between vector , numeric value. options:

  • compare 1 of components of vector: position[i].x < positiontracker
  • compare absolute value of vector numeric value: position[i].length < positiontracker

Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -