Last change
on this file was 7d9c033, checked in by Dmitry Portnoy <dmitry.portnoy@…>, 6 years ago |
Initial commit, code decompiled from a jar
|
-
Property mode
set to
100644
|
File size:
956 bytes
|
Rev | Line | |
---|
[7d9c033] | 1 | import java.awt.image.BufferedImage;
|
---|
| 2 |
|
---|
| 3 | public class ShotType {
|
---|
| 4 | private int x;
|
---|
| 5 | private int y;
|
---|
| 6 | private int speed;
|
---|
| 7 | private int angle;
|
---|
| 8 | private int damage;
|
---|
| 9 | private int firingInterval;
|
---|
| 10 | private BufferedImage pic;
|
---|
| 11 | private long timeLastShot;
|
---|
| 12 |
|
---|
| 13 | public ShotType(final int newX, final int newY, final int newDamage, final int newSpeed, final int newInterval, final BufferedImage newPic) {
|
---|
| 14 | this.x = newX;
|
---|
| 15 | this.y = newY;
|
---|
| 16 | this.speed = newSpeed;
|
---|
| 17 | this.damage = newDamage;
|
---|
| 18 | this.firingInterval = newInterval;
|
---|
| 19 | this.pic = newPic;
|
---|
| 20 | }
|
---|
| 21 |
|
---|
| 22 | public boolean ready() {
|
---|
| 23 | return System.currentTimeMillis() - this.timeLastShot > this.firingInterval;
|
---|
| 24 | }
|
---|
| 25 |
|
---|
| 26 | public Shot produceBullet(final int startX, final int startY) {
|
---|
| 27 | this.timeLastShot = System.currentTimeMillis();
|
---|
| 28 | return new Shot(startX + this.x, startY + this.y, this.damage, this.speed, this.pic);
|
---|
| 29 | }
|
---|
| 30 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.