Hi, I'm hoping someone can help me. This is my first attempt at writing a
Java game (bat_and_ball) and I've got stuck.
It sounds like a simple problem but I've tried everything I can think of and still no joy.
I need my ball to look up the Y co-ordinate (called z) of the bat to see whether it stays in play or goes out. However, when my ball looks up z with using bat.z I get the error "cannot resolve symbol - symbol:variable bat - location class Ball". Here is the important part of the code:
When it compiles bat.z it says "cannot resolve symbol - symbol:variable bat - location class Ball"
But I know that the object bat exists and has a z variable. Here is the code that defines the bat:
And here is the main class that runs the
applet:
Can anyone point me in the right direction? Why can't I access the variable z?
[ August 24, 2004: Message edited by: Martin Platt ]
[ August 24, 2004: Message edited by: Martin Platt ]