This site requires JavaScript, please enable it in your browser!
Greenfoot back
dale1
dale1 wrote ...

2014/6/5

touching movement delay

dale1 dale1

2014/6/5

#
I am trying to make a object move in right for 15 seconds than to the left for 15 seconds when it is touching another object.when i try it the object just only moves back a forth. public void Pipetouch() { if (isTouching(Upipie.class)){ { setLocation(getX(), getY()+3); } } if (isTouching(Spipe.class)){ setLocation(getX()+3, getY()); Greenfoot.delay(5); setLocation(getX()-3, getY()); Greenfoot.delay(5); } }
You need to login to post a reply.