public int timer = 10;
public void act()
{
checkKeypress();
Time();
Pipetouch();
}
public void Time(){
if(timer < 0)
{
timer= timer -1;
}
}
public void Pipetouch()
{
if (isTouching(Upipie.class)){
{
setLocation(getX(), getY()+3);
}
}
if (isTouching(Spipe.class)){
//if (timer 10){
//setLocation(getX()+3, getY());
//}
if ( time>=5){
setLocation(getX()-3, getY());
}
}
//if (isTouching(Spipe2.class)){
// setLocation(getX()-3, getY());
}
i am trying to do is making a timer if the time is less than 5 move left if greater move right but only touching one object.