This site requires JavaScript, please enable it in your browser!
Greenfoot back
decobro
decobro wrote ...

2012/4/9

Assignment to make the classic "Frogger" game.

decobro decobro

2012/4/9

#
Hello, I've been assigned a task to design the classic Frogger game... http://www.happyhopper.org/ if you need a refresher. My code doesn't work for my frog. The error is "illegal start of expression" and the coding is: public void switchImage() { if (getImage() == image1) { setImage (image2); } else { setImage (image1); } } } If you need any more information, give me a buzz! Thanks!
tylers tylers

2012/4/9

#
missing a curly bracket somewhere, not sure where though.
SPower SPower

2012/4/9

#
One } too much at the end...
decobro decobro

2012/4/9

#
I've removed a } at the end, but it hasn't worked!
tylers tylers

2012/4/9

#
copy the whole code for the frog.
tylers tylers

2012/4/9

#
copy the whole code for the frog onto here.
davmac davmac

2012/4/9

#
Exactly - post the code for the whole class, and tell us exactly which line the error occurs on. The real problem is probably somewhere above the code you posted; perhaps the previous method is missing a '}'.
decobro decobro

2012/4/10

#
Okay I have added some squiggly brackets around my code and I have managed to get it working again! Thanks for your help everyone, much appreciated.
You need to login to post a reply.