Search in sources :

Example 1 with GameMatrix

use of yyl.example.exercise.awt.tank.GameMatrix in project yyl_example by Relucent.

the class Mover method hitBorder.

protected boolean hitBorder(int _x, int _y) {
    //
    GameMatrix matrix = GameMatrix.getInstance();
    Rectangle bounds = matrix.getBounds();
    return !bounds.contains(_x, _y, width, height);
}
Also used : GameMatrix(yyl.example.exercise.awt.tank.GameMatrix) Rectangle(java.awt.Rectangle)

Example 2 with GameMatrix

use of yyl.example.exercise.awt.tank.GameMatrix in project yyl_example by Relucent.

the class BulletDestroyd method probe.

/**
	 * ����غ��ϰ�
	 */
protected Collection<Unit> probe() {
    GameMatrix matrix = GameMatrix.getInstance();
    Collection<Unit> units = matrix.inBlock(x, y, width, height);
    units.remove(this);
    return units;
}
Also used : GameMatrix(yyl.example.exercise.awt.tank.GameMatrix)

Example 3 with GameMatrix

use of yyl.example.exercise.awt.tank.GameMatrix in project yyl_example by Relucent.

the class Mover method probe.

protected Collection<Unit> probe(int _x, int _y) {
    GameMatrix matrix = GameMatrix.getInstance();
    Collection<Unit> units = matrix.inBlock(_x, _y, width, height);
    units.remove(this);
    return units;
}
Also used : GameMatrix(yyl.example.exercise.awt.tank.GameMatrix)

Aggregations

GameMatrix (yyl.example.exercise.awt.tank.GameMatrix)3 Rectangle (java.awt.Rectangle)1