当前位置: 技术问答>java相关
求用java编写的俄罗斯方块源程序,急!!!
来源: 互联网 发布时间:2015-10-08
本文导语: 各位大侠,请问谁有啊,简单的就行。我还在试用期,谢谢啊。 请赐网址,或发送至thinkpad@inhe.net | import java.awt.*; import java.awt.event.*; import java.applet.*; public class Tetris extends Applet { public Game game; p...
各位大侠,请问谁有啊,简单的就行。我还在试用期,谢谢啊。
请赐网址,或发送至thinkpad@inhe.net
请赐网址,或发送至thinkpad@inhe.net
|
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
public class Tetris extends Applet {
public Game game;
public int
Offset_x = 40,
Offset_y = 30;
public void init() {
this.setLayout(null);
this.setBackground(Color.white);
game = new Game(this, Offset_x, Offset_y);
game.init();
}
public void start() {
}
public void paint(Graphics g) {
if(game.getHasInit()) game.repaint();
}
public static void main(String[] args) {
Tetris applet = new Tetris();
Frame aFrame = new Frame("¶íÂÞ˹·½¿év1.0 By[csdn_nothing]");
aFrame.addWindowListener(
new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}
});
aFrame.add(applet, BorderLayout.CENTER);
aFrame.setSize(250, 400);
applet.init();
applet.start();
aFrame.setVisible(true);
}
}
import java.awt.event.*;
import java.applet.*;
public class Tetris extends Applet {
public Game game;
public int
Offset_x = 40,
Offset_y = 30;
public void init() {
this.setLayout(null);
this.setBackground(Color.white);
game = new Game(this, Offset_x, Offset_y);
game.init();
}
public void start() {
}
public void paint(Graphics g) {
if(game.getHasInit()) game.repaint();
}
public static void main(String[] args) {
Tetris applet = new Tetris();
Frame aFrame = new Frame("¶íÂÞ˹·½¿év1.0 By[csdn_nothing]");
aFrame.addWindowListener(
new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}
});
aFrame.add(applet, BorderLayout.CENTER);
aFrame.setSize(250, 400);
applet.init();
applet.start();
aFrame.setVisible(true);
}
}
|
已发送,查收