In a game I'm making. I want my character to move down in a decimal speed, but it just turns in a big circle and doesn't fall like it should.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | public class Bag extends SmoothMover { private double BagSpeed = 0.5 ; /** * Act - do whatever the Bag wants to do. This method is called whenever * the 'Act' or 'Run' button gets pressed in the environment. */ public void act() { move(BagSpeed); turn( 3 ); if (Greenfoot.isKeyDown( "right" )) { setLocation(getX()+ 3 , getY()); } if (Greenfoot.isKeyDown( "left" )) { setLocation(getX()- 3 , getY()); } } } |