this is my code and it keeps saying that i am reffering to a non static method in a static way. How do i fix this.
1 2 3 4 5 6 7 8 9 10 | public void act() { if (Greenfoot.mouseClicked( this )) { CannonBall cannonball = new CannonBall(); getWorld().addObject(cannonball, CannonBarrel.getXCB(), CannonBarrel.getYCB()); cannonball.setRotation(CannonBarrel.getRotationCB()); cannonball.move( 4 ); } } |
1 2 3 4 5 6 7 8 9 10 11 | public int getRotationCB(){ return getRotation(); } public int getXCB(){ return getX(); } public int getYCB(){ return getY(); } |