CCB Premier Import

This commit is contained in:
Christian Cunat-Brulé
2018-07-23 10:52:48 +02:00
commit f55475a23f
765 changed files with 209793 additions and 0 deletions

27
01-SOURCES/Bullet.java Normal file
View File

@@ -0,0 +1,27 @@
/*****************************************************
* Beginning Java Game Programming, 2nd Edition
* by Jonathan S. Harbour
* Bullet class - polygonal shape of a bullet
*****************************************************/
import java.awt.*;
import java.awt.Rectangle;
/*********************************************************
* Bullet class derives from BaseVectorShape
**********************************************************/
public class Bullet extends BaseVectorShape {
//bounding rectangle
public Rectangle getBounds() {
Rectangle r;
r = new Rectangle((int)getX(), (int) getY(), 1, 1);
return r;
}
Bullet() {
//create the bullet shape
setShape(new Rectangle(0, 0, 1, 1));
setAlive(false);
}
}