i am currently trying to make it so in my breakout game the ball will go in a certain direction depending on where the ball hits the paddle.
this is the code for the ball but it gives me an error message
im not sure how to fix this
public class Ball extends Actor { /** * Act - do whatever the Ball wants to do. This method is called whenever * the 'Act' or 'Run' button gets pressed in the environment. */ int SpeedY = 5; int SpeedX = 0; public Paddle paddle; public World MyWorld; public void Ball(Paddle paddle, World world){ MyWorld = world; this.paddle = paddle; GreenfootImage img = new GreenfootImage("ball.png"); img.scale(img.getWidth()/12, img.getHeight()/12); setImage(img); Break(); } public void act() { /**GreenfootImage img = new GreenfootImage("ball.png"); img.scale(img.getWidth()/12, img.getHeight()/12); setImage(img);*/ moveAround(); bounce(); Ball(paddle, MyWorld); } public void moveAround(){ setLocation(getX() + SpeedX, getY() + SpeedY); } public void bounce(){ if((isTouching(Paddle.class) || isTouching(Block_1.class)) && this.paddle.getX() < getX()){ SpeedY = -SpeedY; } } public void Break(){ Actor Block = getOneIntersectingObject(Block_1.class); if(Block != null){ getWorld().removeObject(Block); }