我有这句长篇大论。它给了我错误
>= Operand cannot be applied to types Bool and Float
if (tl.State == TouchLocationState.Pressed &&
(tl.Position.X >= harePlayer.Position.X >= tl.Position.X &&
tl.Position.Y >= harePlayer.Position.Y &&
harePlayer.Position.X <= (harePlayer.Position.X + 52) &&
tl.Position.Y <= (harePlayer.Position.Y + 50)))
有人能告诉我修复的是什么吗?谢谢。 :)
答案 0 :(得分:8)
tl.Position.X >= harePlayer.Position.X >= tl.Position.X
c#条件不正确。您必须编写两个单独的条件并使用&&
合并它们:
tl.Position.X >= harePlayer.Position.X && harePlayer.Position.X >= tl.Position.X