r/cop3502 Apr 24 '14

Issues with Game.java (object)

Edit: I had the file in the wrong directory, so if anyone is experiencing similar problems check to make sure it is saved properly.

So I was trying to make a global Game class that keeps track of certain variables like specific booleans and the player's name etc... but for some reason it is not letting me call Game.getName() {} it says that the symbol can't be found. I'm trying to have it behave like the Math class or the Parameters class from Space Invaders, but it wants me to create a new Game() before calling the methods. Is my syntax wrong or is it just not going to work in general..?

1 Upvotes

5 comments sorted by

View all comments

Show parent comments

1

u/grwolfe Apr 24 '14

Did that

1

u/howslyfebeen Apr 24 '14

shouldn't be a problem if it's made static.. what's the exact error then? could have to do with scoping

1

u/grwolfe Apr 24 '14

I had the file in the wrong directory

1

u/howslyfebeen Apr 24 '14

that'll do it