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

2015/7/12

Issue learning Greenfoot

Donte27 Donte27

2015/7/12

#
Hello im just in the beginning stages of learning greenfoot and keep getting a "reached end of file while parsing" error I've looked over the code several times and cant differentiate the difference between what I've typed and the tutorial heres what I wrote: import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) public class Crab extends Actor { /** * Act - do whatever the Crab wants to do. This method is called whenever * the 'Act' or 'Run' button gets pressed in the environment. */ public void act() { move(4); if (Greenfoot.isKeyDown("left")) { turn(-3); } if (Greenfoot.isKeyDown("right")) { turn(3); } }
davmac davmac

2015/7/12

#
The "end of file while parsing" error normally means you've missed out on a '}' bracket. Your brackets must match up - there should be one '}' for every '{'. In this case it looks like you're missing the '}' at the end of the class.
You need to login to post a reply.