Quick question: why is my code not returning true when i use .equal or == for images?
1 2 3 4 5 6 7 8 9 10 11 12 | //above all world class contructor private Actor ShadowPoseChoice = new SimpleActor(), PoseChoice = new SimpleActor(); private GreenfootImage UmarunPose1 = new GreenfootImage( "UmarunPose1.png" ), UmarunPose2 = new GreenfootImage( "UmarunPose2.png" ), UmarunPose3 = new GreenfootImage( "UmarunPose3.png" ), UmarunPose4 = new GreenfootImage( "UmarunPose4.png" ), UmarunPose5 = new GreenfootImage( "UmarunPose5.png" ); //some code to determine what image ShadowPoseChoice is supposed to be //In world class constructor if (ShadowPoseChoice.getImage().equals(UmarunShadowPose1)){PoseChoice.setImage(UmarunPose1);} if (ShadowPoseChoice.getImage().equals(UmarunShadowPose2)){PoseChoice.setImage(UmarunPose2);} if (ShadowPoseChoice.getImage().equals(UmarunShadowPose3)){PoseChoice.setImage(UmarunPose3);} if (ShadowPoseChoice.getImage().equals(UmarunShadowPose4)){PoseChoice.setImage(UmarunPose4);} if (ShadowPoseChoice.getImage().equals(UmarunShadowPose5)){PoseChoice.setImage(UmarunPose5);} |