import java.awt.GridLayout
import java.awt.event.MouseEvent
import java.awt.event.MouseListener
import javax.swing.JFrame
public class Main extends JFrame implements MouseListener {
Block[] block=new Block[9]
Block1 block1=new Block1()
public Main(){
setTitle("别踩白块")
setBounds(200,300,200,300)
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE)
setLayout(new GridLayout(3,3,5,5))
addblock()
bk()
this.setVisible(true)
}
public void addblock(){
for(int i=0i<9i++)
{
block[i]=new Block()
add(block[i])
}
}
public void bk(){
block1.setbk1(block[(int)(Math.random()*2)])
block1.setbk1(block[(int)(Math.random()*2+4)])
block1.setbk1(block[(int)(Math.random()*2+6)])
}
public void over(){
block[3].setText("g")
block[4].setText("g")
block[5].setText("!")
}
public static void main(String[] args) {
// TODO Auto-generated method stub
new Main()
}
@Override
public void mouseClicked(MouseEvent e) {
// TODO Auto-generated method stub
}
@Override
public void mousePressed(MouseEvent e) {
// TODO Auto-generated method stub
if(e.getSource().equals(""))
over()
}
@Override
public void mouseReleased(MouseEvent e) {
// TODO Auto-generated method stub
}
@Override
public void mouseEntered(MouseEvent e) {
// TODO Auto-generated method stub
}
@Override
public void mouseExited(MouseEvent e) {
// TODO Auto-generated method stub
}
}
别踩白块儿。。《别踩白块儿[1]》(iOS版于2014年4月25日改名为《钢琴块儿》[2])是一款非常耐玩的休闲益智游戏,别踩白块儿,这就是这个游戏唯一的一个规则。游戏简单易上手,并且有多重玩法,4月14日至4月18日一周工作日里《[3]别踩白块儿》App Store免费榜登录榜首[1],用户可直接通过app store与手机助手免费下载安装。[4]