1 2 3 4 5 6 7 | if (Greenfoot.isKeyDown( "Enter" )) { if (getImage().equals( "Teddy_Sword_colour_smaller_rightlook.png" )) { addObject( new Slash(),getX(), getY()); } } |


1 2 3 4 5 6 7 | if (Greenfoot.isKeyDown( "Enter" )) { if (getImage().equals( "Teddy_Sword_colour_smaller_rightlook.png" )) { addObject( new Slash(),getX(), getY()); } } |
1 | getWorld().addObject( new Slash(), getX(), getY()); |