I want to have a shell that falls to the ground when the shot is fired but im struggling to have a randomiser
does any body have any idea please help


1 2 3 4 5 | int RandomNum = 0 ; public void RandomNumber( int min, int max) { RandomNum = Greenfoot.getRandomNumber(max-min)+min; } |
1 2 3 4 5 6 7 8 9 | public void fire() { Bullet b = new Bullet(); getWorld().addObject(b,getX(),getY()); //shell s= new shell(); //getWorld().addObject(s,getX(),getY()); b.setRotation(getRotation()); b.move( 20 ); } |
1 2 3 4 5 6 7 8 9 10 11 | public void act() {move( 1 ); } public void fall() { int r=Greenfoot.getRandomNumber( 100 )- 50 ; turnTowards(r+ 70 , 600 ); } |