posted 18 years ago
It's really annoying because it seems logical enough to me and I'm sure it's something really simple. I hope someone can help me. It's a bat and ball game to which I'm adding a computer opponent. The problem occurs in the Ball code:
and throws the exception because it doesn't like aii.b. But it has no problem in the next if statement:
if ((int)(x)>=490 && y>james.z-6 && y<james.z+35+6)
which is exactly the same logic.
Here's the main programme
And here's the Ball code...
Here's the Player code...
And finally here's the AI code...