Unexpected token
in
Programming Questions
•
2 years ago
I was trying out a few sketches from 'Getting Started with Processing' and I keep encountering "Unexpected token:Bee". I have checked the curly brackets and the semi-colon and everything seems to be fine. Dose anybody know how I can resolve this problem?
- Bee bot1;
- Bee bot2;
- Void setup(){
- size(720, 480);
- bot1 = new Bee("bee1.svg",90,80);
- bot2 = new Bee("bee2.svg",440,30);
- smooth();
- }
- void draw() {
- background(204);
- //upload and display first bee
- bot1.update();
- bot1.display();
- //Update and display second bee
- bot2.update();
- bot2.display();
- }
- Class Bee {
- float xpos;
- float ypos;
- float angle;
- PShape botShape;
- float yoffset = 0.0;
- //set initial values in constructor
- Bee(String svgName, float tempx, float tempy) {
- botShape = laodShape(svgName);
- xpos = tempx;
- ypos = tempy;
- angle = random(0, TWO_PI);
- }
- //upload the fields
- Void update() {
- angle += 0.05;
- yoffset = sin(angle)*20;
- }
- //Draw the bee to the screen
- Void display(){
- shape(botShape, xpos, ypos + yoffset);
- }
- }
1