blackjack.java
来自「Java Game: Puzzle & Black Jack !」· Java 代码 · 共 35 行
JAVA
35 行
import java.applet.Applet; // for Applet
import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;
import javax.swing.*;
class CARD
{
public int no;
public int x, y;
public boolean showingBack;
private final int pokerW=71, pokerH=96; // constants
public CARD()
{
this(0); // same as calling constructor CARD(0)
}
public CARD(int n)
{
no = n;
showingBack = true;
}
public void setXY(int x, int y)
{
this.x = x;
this.y = y;
}
public boolean isHit(int cx, int cy)
{
if ( cx<x || cx>=x+pokerW || cy<y || cy>y+pokerH )
return false;
else
return true;
}
// setXY(.)
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?