import hsa.Console;
import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;
import java.io.*;
import javax.imageio.*;
import javax.swing.*;
import java.awt.event.*;
public class JumpyVayne
{
static Console c; // The output console
public static void main (String[] args) throws IOException
{
BufferedReader myInput = new BufferedReader (new InputStreamReader (System.in));
c = new Console ();
String space;
BufferedImage img = null;
try
{
img = ImageIO.read (new File ("Vayne2.png"));
}
catch (IOException e)
{
}
public void keyPressed (KeyEvent e)
{
if (e.getKeyCode () == KeyEvent.VK_SPACE)
{
jumping (img);
}
}
}
public static void jumping (BufferedImage img_)
{
for (int y = 350 ; y > 200 ; y--)
{
c.drawImage (img_, 90, y, null);
}
for (int y = 200 ; y < 350 ; y++)
{
c.drawImage (img_, 90, y, null);
}
}
}
我已经尝试了所有的编码能力(这并不是很多)才能让它发挥作用。我一直在收到错误,而且我真的不知道如何修复它们。如果你们可以通过告诉我这是错误的,那会很有帮助。该图像应该是“跳跃”。当你按空格键,但我不能让它工作。另外,如果我输入了太多东西,你能告诉我什么不需要以及它会用于什么?谢谢:))