This site requires JavaScript, please enable it in your browser!
Greenfoot back
daverider05@gmail.com
daverider05@gmail.com wrote ...

2017/11/3

my code is not working...help?

{ setLocation( getX(), (int) (getY() + dy) ); // If user pressed UP arrow, launch Flappy Bird upward if (Greenfoot.isKeyDown("up") == true) { dy = -15; } dy = dy + g; } i am wondering why this code is not correct..some one help me...
danpost danpost

2017/11/3

#
You will need to show more code both for context and what might be wrong. Use code tags.
oh ok...here is my code on th actor import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) /** * Write a description of class FlappyBird here. * * @author (your name) * @version (a version number or a date) */ public class FlappyBird extends Actor { double dy = -0; double g = 1.3; /** * Act - do whatever the FlappyBird wants to do. This method is called whenever * the 'Act' or 'Run' button gets pressed in the environment. */ public void act() { setLocation( getX(), (int) (getY() + dy) ); // If user pressed UP arrow, launch Flappy Bird upward if (Greenfoot.isKeyDown("up") == true) { dy = -15; } dy = dy + g; } might any one know what is wrong with it
its telling me "reached end of file while pursing"
danpost danpost

2017/11/4

#
daverider05@gmail.com wrote...
its telling me "reached end of file while pursing"
You probably just need another closing bracket at the end of the class.
You need to login to post a reply.