So, i am making a game with a friend of mine and we know a lot of stuff about coding. But the thing is, the character (Sheep) that we are using for our Pong game will not register that it is hitting Paddle1. My code is pretty simple but it still doesnt work... Please help!!
/**
* Act - do whatever the Sheep wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
move(1);
if(Greenfoot.getRandomNumber(300)<5){
turn(Greenfoot.getRandomNumber(300)-20);
}
if(atWorldEdge()){
turn(180);
}
Actor paddle = getOneIntersectingObject(Paddle1.class);
if(Paddle1.class!=null){
move(15);
}
if(Paddle1.class==null){
turn(Greenfoot.getRandomNumber(300)-50);
move(1);
}
Actor paddle2 = getOneIntersectingObject(Paddle2.class);
if(Paddle2.class!=null){
move(15);
}
if(Paddle2.class==null){
turn(Greenfoot.getRandomNumber(300)-50);
move(1);
}
if(atWorldEdge()){
getWorld().removeObject(this);
}

