So guys just wanted to ask could we move an object upwards in a smooth way other than just teleporting?
This is my code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | public void act() { if (isTouching(MAN. class )) { setImage( "lift-closed.png" ); Greenfoot.delay ( 1 ); setLocation(getX(), getY()- 300 ); } if (isTouching(TRIGGER4. class )) { setImage( "lift-open.png" ); getWorld().addObject( new MAN2(), 698 , 246 ); } if (isTouching(TRIGGER3. class )) { setImage( "lift-closed.png" ); } } |