java桌面弹球
道具类(Magic) public LongMagic(String path, int x, int y) throws IOException { super(path, x, y);} public void magicDo(Stick stick) /* 道具的功能 : 档板变 长*/ { double imageWidth = stick.getImage().getWidth(null); if (stick.getPreWidth() = imageWidth) // 如果档板没有变长过 { stick.setPreWidth((int) (stick.getPreWidth() * 2));// 将档板的长度改为双倍 } } LongMagic 道具类(Magic) public ShortMagic(String path, int x, int y) throws IOException { super(path, x, y);} public void magicDo(Stick stick) /*道具的功能 : 档板变短*/ { double imageWidth = stick.getImage().getWidth(null); if (stick.getPreWidth() = imageWidth) // 如果档板没有变短过
原创力文档

文档评论(0)